Questions tagged [json]
The json tag has no usage guidance.
55
questions
0
votes
0
answers
52
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
103
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
0
answers
33
views
JSON File not Opening in VS Code
JSON error showing I come from Windows to Ubuntu so this file is created in Windows but it does not support Ubuntu:
0
votes
1
answer
231
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 ...
0
votes
1
answer
680
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 ...
0
votes
1
answer
493
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
77
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
52
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
8k
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
16
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
39
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
4k
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
159
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 .[]
{
&...
2
votes
0
answers
590
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
230
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
2k
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
51
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
2k
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
1k
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
371
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
3k
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 ...
1
vote
1
answer
1k
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
3k
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
531
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
653
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 ...
15
votes
3
answers
21k
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
9k
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
23k
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
723
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
78
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
25
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 ...
3
votes
1
answer
6k
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
70
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
367
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
6k
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
352
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
315
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
301
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
120
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
1k
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 ...
1
vote
1
answer
976
views
searching for specialized patterns using grep in a json file
I wonder how can I only grep the "created_at": ones that are followed by }, and a new line like below:
"hashtags": [],
"urls": []
},
"created_at": "Wed Oct 19 22:19:42 +0000 ...
1
vote
1
answer
5k
views
edit json file using script [duplicate]
I have a json file that it has more than 30k lines, and I need to replace all instances of }{ in the file with },{ by using script shell or just a text editor like less or vim.
24
votes
4
answers
29k
views
Bash CLI remove quotes from output of a command
I am trying to load a JSON file using jq per here. It is quite straightforward and this works:
$ cat ~/Downloads/json.txt | jq '.name'
"web"
However, I need to assign the output of this variable to ...
0
votes
0
answers
554
views
How to recover json firefox files using photorec testdisk?
On the wiki it says that json files are supported but json file format is not listed when using photorec file options.
On the cgsecurity forums, some people have suggested that this is considered a ...
1
vote
3
answers
2k
views
getting daily data consumption value from vnstat in JSON
I want to retrieve the daily internet usage from my Ubuntu machine in Json format using Vnstat.
To fetch the daily usage in terminal I use following command:
vnstat -d -i wlp2s0
the output will be:
...
4
votes
3
answers
4k
views
"jsonlint: command not found", although jsonlint IS installed
I am interested in using jsonlint on commandline in my Ubuntu 16.04 OS. So I executed
sudo apt-get install jsonlint
and I got
Reading package lists... Done
Building dependency tree
Reading ...
2
votes
3
answers
31k
views
grepping patterns in a json file
How can I select the lines from my text files similar to this one
"created_at": "Wed Oct 19 12:36:54 +0000 2016"
basically I need to find lines with the pattern
starts with Wed Oct 19 and
ends ...
4
votes
2
answers
325
views
How can I structure jq filters to return video and audio codec information from ffprobe?
In the interest of standardizing my video library I'm trying to find a way to quickly create a list of files that need to be converted. After looking at this question and its answer (and much googling)...
1
vote
2
answers
15k
views
How to install the JSON extension for Ubuntu 16.04? [duplicate]
I want to install the JSON extension as is mentioned in prerequisites to use People Api by Google. You can refer to the documentation.
I've php7 installed on Ubuntu 16.04.