Podcast #128: We chat with Kent C Dodds about why he loves React and discuss what life was like in the dark days before Git. Listen now.

Questions tagged [json]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
2
votes
1answer
39 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 ...
0
votes
0answers
61 views

Browser calls .php calls .sh calls .py but .py doesn’t run

I have a backend on a web server running Apache2 on 18.04 LT. The backend responds to web queries from Excel. The raw data comes from other websites. The return from the other websites includes html, ...
0
votes
0answers
39 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 | ...
0
votes
0answers
27 views

Using a cat * > function for files in a specific category

I'm trying to cat all .json files in the D:\Dumps\Dumps2019-10-17 directory and for the life of me I can't figure it out. Please help. Edit: I'm using the obunto terminal on a windows 10 os.
1
vote
1answer
38 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 ...
8
votes
2answers
497 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
309 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": "...
3
votes
1answer
413 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
112 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
38 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
22 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 ...
0
votes
1answer
958 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
35 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
0answers
388 views

OpenVPN server user connection notification

I've setup an OpenVPN complete server, perfectly working and everything okay. I've tried to setup and email notification when a user connects to the vpn, but the params pointed on the documentation (-...
0
votes
1answer
183 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
2k 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
93 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
128 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
39 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
71 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
692 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
398 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
2k 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.
10
votes
4answers
12k 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
341 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
673 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: ...
1
vote
1answer
2k 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
13k 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
185 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
12k 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
418 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
1k 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
3answers
2k 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":[{.........
10
votes
3answers
11k views

JSON Valdiator in Ubuntu 16.04

I have tried to get hands on some JSON file validators. I came across jq. But after running 'jq . file.json' I got JSON formatted output. That command didn't gave me validation of JSON in my file. I ...
1
vote
2answers
6k 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: { "...