Questions tagged [jq]
8 questions
3
votes
1 answer
jq sort by date (iso 8601)
I try to sort json by date (field CreationTimeUTC) in iso 8601 format with jq 1.5.
I found this post, but that return : 'Cannot index boolean with string "CreationTimeUTC"'
jq '.Entities.BackupJobSessions.BackupJobSessions[] |…
user5525652
- 137
- 1
- 4
- 12
3
votes
1 answer
jq : Get values from children array and display on parent array
I try to get theses value :
"VmDisplayName, CreationTimeUTC, EndTimeUTC, Reason, Result, State, TotalSize, BackupServerReference, BackupJobSessionReference" from this json :
{
"JobSessionUid":…
user5525652
- 137
- 1
- 4
- 12
0
votes
1 answer
automatically detect an apache server running on a specific vm and zone in Google Cloud Platform
Note: This is a self-answered question, which is allowed here. If you have better solutions go ahead and post them.
Hypothetical automation for a web-based cloud school needs to test if students have some minimal competence before proceeding. …
Paul
- 1,626
- 15
- 19
0
votes
1 answer
Get outputs from jq specific line
The command:
create_subnet=$(aws ec2 create-subnet --vpc-id "$create_vpc" --cidr-block 10.0.1.0/24 | jq -r '.subnet[].subnetid')
The output:
"subnet": {
"availabilityzone": "us-west-1b",
"availabilityzoneid": "usw1-az3",
…
rikorey
- 5
- 2
0
votes
1 answer
Shell script not reading the file as expected
Below is the script trying to be executed:
read n
for ((i=1;i<=$n;i++))
do
file=createserver"$i".json
echo $file
instanceid[$i-1]=$(jq -r '.instance.id' ./$file)
echo $instanceid
done
$file displays correct value. However, $instanceid is not. The…
serverstackqns
- 722
- 2
- 16
- 39
0
votes
1 answer
Issues with converting JSON to CSV with nested values
So far I have had no problems converting standard JSON to CSV with jq in the past. But now my data becomes complicated.
Major base tags are account and subaccount. All other values are variables. The entry year got variable values and changed by…
safect
- 3
- 4
0
votes
1 answer
Tranforme each item in JSON array to JSON Object
I need to transform this simple JSON array :
["169","19","33"]
To a more complicated JSON Object for each item, like :
{
"groups": [
{
"groupid": 169
},
{
"groupid": 19
},
{
"groupid": 33
}
…
user5525652
- 137
- 1
- 4
- 12
-1
votes
1 answer
Can I pipe a "tail -f " with mixed data containg JSONs to jq to visualize JSONs?
I´ve playing for a whilen and resarching but I´m not able to find a solution.
I have some huge logs, where sometimes there are also huge JSONS. But to simplify imagine the following:
mkdir logs
cd logs/
echo "$(date) [INFO] something" >>…
nck
- 129
- 1
- 7