Skip to content

Tag: json

Linux grep command to find the value of key from json

I have a JSON output that contains a list of objects stored in a variable.(I may not be phrasing that right) Output of a curl command: will post in comment as I am unable to post here I want to grep the value at this position “ad6743fae9c54748b8644564c691ba58” shown in the output, which changes ev…

Bash Jq parse json string

I’ve to call a file and pass a json as parameters in this way (suppose that my file is called test.sh), from bash I need to do something like this: and the content of test.sh is the following the output of -> printf “$system_user” is but the output of -> printf “$accounts” …

diagnosing when I’m being limited by disk i/o

I’m running Python 2.7 on a Linux machine, and by far the slowest part of my script is loading a large json file from disk (a SSD) using the ujson library. When I check top during this loading process, my cpu usage is basically at 100%, leading me to believe that I’m being bottlenecked by parsing …

Linux cut pattern from log file

i have json log file but theres not only json i need to cut/remove everything what isnt json, structure looks like this: i tried cut -d command but it doesnt work for me Answer This did the work:

jq in shellscript: parse argument with ‘-‘

Here’s the json I need to parse: And my code to parse is like the following: The problem is this part: I can’t get the value of it and I guess the reason is that I didn’t pass $var correctly? I also tried But it doesn’t work..Maybe the tiny ‘-‘ in the “config-$val&#82…