Questions tagged [json]
JSON stands for JavaScript Object Notation. Use this tag for questions about the JSON format itself, and for questions on how to convert, manipulate and distribute JSON data.
64
questions
0
votes
0
answers
17
views
WebOS-manager installation from github on Ubuntu 24.04
I was trying to install WebOS-dev-manager from the GitHub repository via
git clone https://github.com/webosbrew/dev-manager-desktop
but I don't know how to proceed with the installation further.
I ...
1
vote
0
answers
38
views
Looking for graphical JSON editor
I'm looking for a software that can load a JSON file and show it like a spreadsheet with the option to search and filter the data. Editing and saving are optional, but would be great as well.
Easiest ...
-1
votes
0
answers
25
views
Ubuntu compliance script for defender [closed]
I'm trying to do a compliance script for microsoft defender in Intune. But it seems to fail, anybody with little experince in this field? In order to do the script I have made a shell script and a ...
2
votes
2
answers
5k
views
How to know a JSON array is an empty array in bash?
I use this code to consume GitHub API and automate some tasks:
curl --silent -H 'Authorization: token github_access_token' 'https://api.github.com/orgs/OrganizationName/repos?per_page=100'
Sometimes ...
1
vote
2
answers
2k
views
Verify syntax of JSON file from command-line (CLI sanity check)
What's the simplest command that I can run on Ubuntu Linux to verify the sanity of a JSON file?
I have a very long JSON file that I just edited with vim. I want to make sure my changes didn't ...
0
votes
2
answers
716
views
How to parse large files looking for a word
I have some extremely large json files
I am not even really sure if some are even written correctly
Therefore viewing the with a editor is not possible (it freezes vscode etc)
I can view them with ...
3
votes
1
answer
771
views
Firebase private key file as environment variable
I'm very new to Ubuntu and developing a project based on firebase firestore database. Trying to run services on ubuntu server 22.04. I can connect firestore database (in windows I can do this by using ...
4
votes
4
answers
4k
views
Convert text file to CSV on shell
I would like to convert a text file into CSV format.
Here is an excerpt from the file:
{"Outdated":false,"Watt":233,"Timestamp":1669647142,"A_Plus":6523.896,&...
3
votes
1
answer
5k
views
jq how to replace a clear text to a text variable
When I use commmand:
jq -r '.balances[] | select(.asset=="BTC").free' wallet.json
result: "4723846.89208129"
When I use command:
coin2=BTC
jq -r '.balances[] | select(.asset==&...
2
votes
1
answer
3k
views
Fastest way to create a JSON file containg all the file names in a directory
I have a directory with a huge number of large files, several hundred gigabytes. I want a JSON file containing the filenames of all said files. Some of these files are in folders. I would appreciate ...
0
votes
0
answers
473
views
How do I get formatted responses from terminal?
I'm struggling to understand the response that I receive from the terminal as it is all pasted in one line without indentation, line breaks, etc. Is there a way to enable that? Or some command? This ...
0
votes
1
answer
4k
views
Parse JSON in Bash
I'm making a polyglot program, which takes input and runs files. I would like to run a command for a list of languages. Currently, I only have JavaScript and Ruby supported. My JSON file named ...
0
votes
1
answer
3k
views
How to pass json parameters for Jenkins using CURL?
I'm trying to build a job by passing JSON parameter for Jenkins through Linux CLI. But I'm not able to pass the parameters in JSON. I have used -g to turn off globbing. Still the issue persists. Any ...
2
votes
3
answers
6k
views
Where is the JSON Config File for Discord Installed Via Snap?
The only .json files I can find are build_info and manifest (I don't think either of them are config files).
Forgive me if my question is too amateurish, I just installed Ubuntu recently. I'm trying ...
1
vote
1
answer
2k
views
Using JQ and curl to get list of all ID's that have a certain type
Been spending hours attempting to get this working.
So https://launchermeta.mojang.com/mc/game/version_manifest.json contains every single version of the game ever made.
I want to get a list of all ...
0
votes
1
answer
187
views
How to filter data through awk or grep to get the time only?
curl -H Metadata:true --noproxy "*" "http://169.254.169.254/metadata/instance/compute/tagsList?
api-version=2019-06-04"|
Through the above command I'm getting out put like below
...
0
votes
1
answer
86
views
What does the output mean mvt-ios pythonstix2 JSON file analysis?
I have run decrypted JSON file with pythonSTIX2 as per mvt-ios guide. I now have an output I do not understand. Any suggestions comments much appreciated.
a@a:~/Peg$ mvt-ios check-backup --iocs ~/Peg/+...
-1
votes
3
answers
23k
views
How to extract a string from a json file and put into a variable (Linux)
I have the following in one of my json file file1.json :-
{
"$quer": {
"args": [{
"args": [
"select\n db1.table1 as tab1,\n db1.table2 ...
0
votes
1
answer
25
views
intermidiate user, I have to alter a json file to incorporate new values help please?
This is the code I have to alter, I have copied the file into terminal and now need to put my own ID etc into the code. I used Cat do see this code but not sure how to edit it. Any help appreiated as ...
0
votes
1
answer
54
views
Is it possible to parse only "version":"8.9" from json file
I have this json data and I want to parse only version:8.9 from it is it possible to do ?
{
"version": "8.9",
"description": "Long-Term Support version - ...
0
votes
1
answer
7k
views
how to change value in json with jq when path to key is only reachable through select()
Let's start with an example output:
{
"title": "The Flash (2014)",
"alternateTitles": [
{
"title": "The Flash",
"seasonNumber&...
-1
votes
1
answer
2k
views
How to grab keys and values of a json output and make new valid json with those?
I can make an request to the sonarr api which will give me the following output:
curl -sL "http://192.168.2.15:8005/api/series/lookup?term=tvdb:81189&apikey=[[REMOVED]]" | jq .[]
{
&...
4
votes
0
answers
3k
views
Graphical folding editor for JSON?
The Ubuntu repositories come with the package xmlcopyeditor, which installs XML Copy Editor; a nice, graphical folding editor for the somewhat outdated XML data file format.
I am looking for a ...
2
votes
1
answer
395
views
JSON Windows exe through Wine
I am from India. The Income Tax efiling site was providing .jar file which could be run through JRE Version 8 to prepare the Income Tax Return since the year 2013-14 till 2020-21 (for 8 years) and I ...
2
votes
1
answer
9k
views
grep a string in a json output
I have an api-request that gives the output in the json form (form? layout? body? how do you say that?). See here:
{
"title": "Another Life (2019)",
"...
0
votes
1
answer
55
views
Copy Contents of TXT file to bash subfolder
I have an Input String
[
{
"name": "administrators",
"description": "Default group for DSS administrators",
"sourceType": ...
0
votes
1
answer
3k
views
Replacing JSON text with JQ
I have a few JSON files, the structure varies slightly (can have multiple "Columns")
but they look like this:
[{"data":"redacted1","type":"unknown"},{&...
2
votes
2
answers
2k
views
Create and append key value pairs to a file of JSON objects with a regex of each JSON object value
I have a big file that contains json objects each object in a new line.
File example
{"Name" :"%Hana-29-Mrs-Smith","job":"engineer"}
{"Name" :"%...
0
votes
1
answer
646
views
How to grep a identical word in json file format
Here is my command:
aws logs describe-metric-filters --log-group-name mahi | jq '.metricFilters[].metricTransformations' | grep "metricName"
output:
"metricName": "APIMetric&...
0
votes
1
answer
4k
views
How to retrieve a value from a JSON using bash?
I have a command in a bash pipeline that returns me a JSON like the follow:
$ aws iot get-registration-code
{
"registrationCode": "abcd635"
}
I would to have the value abcd635 inside a variable ...
2
votes
1
answer
2k
views
Using Json1 Extension with sqlite3
The docs says, that The json1 extension is a loadable extension for sqlite3, and the loadable extensions need to be compiled as shared libraries (source).
I searched a lot and I don't know how to ...
4
votes
2
answers
2k
views
How to read .json to output an specific number?
Hello I've been using this:
curl -s "http://api.openweathermap.org/data/2.5/forecast?id=6361046&APPID=6be5e3a6e62680c28044791e8fc7b568&units=metric" -o ~/.cache/weather.json
to write a ...
2
votes
1
answer
5k
views
'sed' not replacing text in file
I am attempting to replace tokens in a JSON file with values held in our CI tool of choice (Bamboo).
To do this, I am using jq to extract an array of values, and then replacing the token in each ...
1
vote
0
answers
740
views
JSON TO CSV WITH JQ PLAY ERROR
I am new to this. Please forgive me. I am trying to make a CSV file from JSON data. I got far but my data is complex.
I am using this line:
jq --raw-output '(map(keys) | add | unique) as $cols | map(. ...
2
votes
2
answers
1k
views
journalctl json output breaking python's json parser
ubuntu 19.04
python 3.7
Create a json file:
journalctl -ojson -r > a.json
Now read it in :
with open('a.json') as infile :
data = json.load(infile)
Traceback (most recent call last):
File ...
16
votes
3
answers
29k
views
In Windows Terminal running Ubuntu, how can I make the default directory be ~ (/home/jake) instead of / (root)?
I have both Windows Terminal and Ubuntu installed from the Microsoft Store inside of Windows 10 (I don't know if this is WSL Version 1 or Version 2. The wsl -l -v command failed.).
My default ...
1
vote
3
answers
13k
views
Bash, get value from json line
System
Linux local 5.0.0-27-lowlatency #28-Ubuntu SMP PREEMPT Tue Aug 20 20:33:37 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
Issue
I have input file.
{ "article": {"code": "01333457004","name": "...
4
votes
1
answer
32k
views
How to send JSON as variable with bash curl?
I'm trying to send a POST request with curl, but I'd like to store the json data in a variable in order to resend it if an error occur.
I used this code:
jsonvariable="{"ora" : "value1", "temp" : "...
0
votes
1
answer
866
views
Insert value from JSON file into filename path
I need to copy a file and rename it based on a value from a json file:
info.json
{
"folderName": "berlin"
}
to get the folderName from json I can use:
jq '.folderName' info.json
to copy the file ...
1
vote
0
answers
103
views
Ubuntu-Mate-Welcome cannot open applications.json
Ubuntu 18.04
When I run Ubuntu-Mate-Welcome I get this error and the software boutique never populates.
IndexError: list index out of range
[Apps] Software Index JSON is invalid or missing!
[Apps]...
0
votes
0
answers
28
views
Call remote servers using a google cloud product
I have the following use case that I was trying to find a google solution for. I wanted to be able to call a remote server to get some data. The data comes back as XML. Then I wanted to extract ...
4
votes
1
answer
8k
views
Modifying Large JSON Files in Linux
I have a need to modify large JSON files that choke most editors (meaning: most editors will take a long time to open the file, and even after the file is loaded, the editor will become unresponsive ...
0
votes
2
answers
176
views
Parse response from Consul in Bash
I am using bash to get a value back from Consul, I have the API call working but can't seem to get the parsing down. I have tried regex and also jq but neither seem to work. Below is the results of ...
0
votes
1
answer
496
views
How to set the network proxy for ubuntu 16.04?
I have installed shadowsocks, and start it by typing:
sslocal -c /etc/shadowsocks/config.json -v start
If I set network proxy in Automatic method with a *.pac file, it works. I can view google, but ...
3
votes
3
answers
9k
views
How to set boolean value in curl command used bash script
I need set into variable true/false value and send him into json with curl command:
name=$1
sx=$2
`curl -d '{"name":"'"$name"'", "sex":true}' -H "Content-Type: application/json" -X POST http://...
0
votes
0
answers
442
views
how to preserve the order of tags while coverting xml to json in python using xmlutils
I have following xml code chunk:
offset
len
p_val
while i covert it to json using below python code the order of tags are changing as below:
...
0
votes
1
answer
386
views
How to fix windscribe Json object couldn't be decoded
So basically I am trying to run this VPN, windscribe. To start I am running this commond
sudo /etc/init.d/windscribe-cli start
and I got this error:
Traceback (most recent call last):
File "...
1
vote
0
answers
494
views
Output disc space of folders as JSON
I want to output the size of folders to a json file with the following command
tree -d -JL 3 --charset utf-8 --du $HOME/share >> discspace.json
But the command won't output valid json. Instead ...
3
votes
1
answer
209
views
searching for "created_at": followed in the next line by "retweeted": in lots of json files for a specific range
I have a large amount of json files and previously I was told to use the following line to search if a tweet is created at a specific time range in a date:
grep -wirnEzc '},.*created_at":\s"Wed Oct ...
3
votes
1
answer
2k
views
Cronjob saves json into a wrong directory [duplicate]
There is a Cron job on Ubuntu 16.04 which runs a PHP script
$parseinfo = 'parseme.json';
$handle = fopen($parseinfo, 'w');
fwrite($handle, json_encode($res));
to parse data into a JSON file. The PHP ...