Questions tagged [json]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1
vote
0answers
22 views

How to pass .json file in a .sh script so that the Jenkins build will install/include it

When running some integration tests on Jenkins, I get this: "[Failed to read configuration file. Failed to open JSON file '/etc/ara_tsyn.json'.]" Locally, I don't get this error cause i have ...
0
votes
1answer
32 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
1answer
40 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
1answer
41 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
0answers
48 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
1answer
119 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
1answer
91 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
0answers
92 views

web_js installation: found one low severity vulnerability

I am working on Ubuntu 20.04 osboxes.org virtual machine installed on Ubuntu 18.04. I used the following command to install web3: npm install web3 I got the following message: • web3@1.3.1 added 352 ...
0
votes
1answer
49 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
1answer
504 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"},{&...
0
votes
0answers
282 views

curl: How to pass a file content inside json

I've seen some similar question headings, but none is doing what I intend. I have a service that is expecting a long string, like so: curl localhost:1234 -X POST -H "Content-Type: application/...
1
vote
2answers
624 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
1answer
108 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
0answers
252 views

Received 0 SUCCESS signal(s) out of 1. Unable to satisfy 100% MinSuccessfulInstancesPercent requirement

{ "AWSTemplateFormatVersion": "2010-09-09", "Parameters": { "VpcId": { "Type": "AWS::EC2::VPC::Id", ...
0
votes
1answer
2k 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
1answer
908 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
2answers
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
1answer
2k 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
0answers
390 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(. ...
1
vote
2answers
408 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 ...
13
votes
2answers
14k 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
3answers
5k 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
1answer
14k 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
1answer
555 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
0answers
63 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
0answers
23 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 ...
1
vote
1answer
4k 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
2answers
48 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
1answer
317 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 ...
2
votes
3answers
4k 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
0answers
316 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
1answer
236 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
0answers
213 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
1answer
90 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
1answer
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
1answer
733 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
1answer
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.
17
votes
4answers
24k 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
0answers
462 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
3answers
1k 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
2answers
3k 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
3answers
24k 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
2answers
263 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
2answers
14k 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.
-1
votes
1answer
574 views

How to pass the character sequence ./abcd.sh '{\“type\”:\“path\”,\“key\”:[]}' as an argument to a script?

I've written a shell script, called keepAbcdRunning, whose job it is to check whether command / process 'abcd' is running and if it isn't, to start it. keepAbcdRunning has the form: #!/bin/bash if ...
0
votes
1answer
3k views

How to remove the first key of JSON file?

I have a very big 5 GB json file. I am trying to remove the first key from the file. Input: {"url":"example.com","original_url":"http://example.com","text":"blah...blah"...} I tried: jq 'del(....
3
votes
4answers
4k views

How to remove only the last forward slash in the field?

I have a json file where I need to remove the last forward slashes only. See the example: {"url":"http://example.com/vary/file/","originalUrl":"http://example.com/vary/file/","applications":[{.........
15
votes
4answers
28k views

JSON Validator in Ubuntu 16.04

I am trying to get my hands on some JSON file validators. I came across jq but after running jq . file.json I only got JSON formatted output, not a validation of the JSON in my file. I want to know ...
1
vote
2answers
9k views

How I can make the text file to json file? [closed]

I have text file containing something like the following: google.com,father@google.com,json@google.com latter.com,john@latter.com I am trying to convert this text to Json format like this: { "...