Questions tagged [json]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
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 ...
user avatar
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 ...
user avatar
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:
user avatar
  • 1
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 ...
user avatar
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 ...
user avatar
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 ...
user avatar
  • 3
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 ...
user avatar
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/+...
user avatar
-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 ...
user avatar
  • 121
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 ...
user avatar
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 - ...
user avatar
  • 1
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&...
user avatar
  • 542
-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 .[] { &...
user avatar
  • 542
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 ...
user avatar
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 ...
user avatar
  • 131
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)", "...
user avatar
  • 542
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": ...
user avatar
  • 1
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"},{&...
user avatar
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" :"%...
user avatar
  • 133
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&...
user avatar
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 ...
user avatar
  • 1,040
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 ...
user avatar
  • 741
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 ...
user avatar
  • 303
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 ...
user avatar
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(. ...
user avatar
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 ...
user avatar
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 ...
user avatar
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": "...
user avatar
  • 788
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" : "...
user avatar
  • 43
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 ...
user avatar
  • 145
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]...
user avatar
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 ...
user avatar
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 ...
user avatar
  • 2,042
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 ...
user avatar
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 ...
user avatar
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://...
user avatar
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: ...
user avatar
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 "...
user avatar
  • 141
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 ...
user avatar
  • 11
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 ...
user avatar
  • 3,691
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 ...
user avatar
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 ...
user avatar
  • 3,691
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.
user avatar
  • 231
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 ...
user avatar
  • 723
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 ...
user avatar
  • 109
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: ...
user avatar
  • 13
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 ...
user avatar
  • 215
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 ...
user avatar
  • 3,691
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)...
user avatar
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.
user avatar
  • 63