it helped me a lot without loosing much time. The way how you recorded it, was also entertaining. I am interested in a video if you can filter the API or more videos with examples on filtering with jq. Dziekuje bardzo!
So "artistically" and for entertainment, outstanding (the intro). But for wanting to get to the content to "grab" what I was looking for, may cause frustration. Although, I was in that boat and did not get frustrated because I liked the intro and the quality of the footage REALLY stood out! So....take it for what its worth. 😅
I recommend ijq as an interactive jq. Not only you get the output as you type, but it has autocompletion, so you don't have to study the input beforehand that much.
Good evening sir, thank you for the knowledge. I want to ask, I have a log file that needs to be parsed and displayed, how to do it with jq? because the file extension is log not json
I'm not sure how to help you, Muhaammad. Log files usually consist of a different format than the JSON one. However, if your log file is a file that contains only valid JSON objects one under another, then you should be able to use it as an input for a jq (I haven't done anything like this, so I'm just guessing here.) But if your log file is not a valid JSON document (or documents), then there is nothing you can do.
@@szymonstepniak thanks for helping, I'm done with my case. I shouldn't have to pay attention to the file extension, because the contents are already json and can be parsed
It depends which element you want to pick from the list. You can use '.[n]' operator, where n is the index number. (E.g. "echo '[1,2,3,4]' | jq '.[0]'" => 1) Hope it helps. Take care, and have a good day!
So cool, this is best tool, better JOLT written on JAVA. For parsing any data source and resolve to change format this is fast and easy. Thank you for video!
Thanks a lot! I haven't heard about this JOLT, thanks for sharing the information. I will take a look at it out of curiosity, but I assume it cannot compete, as you mentioned, with the jq very well :) Good luck and happy hacking!
Hi Matthias! I think speed in this case is the least important thing you should focus on. If you are a Python developer and you already have a script that consumes some JSON and extracts interesting information, writing another such a script is a better choice. If you don't know Python and you don't want to install a general purpose programming language to do some JSON document transformations, jq is the tool that is designed just for this purpose (and it is a single binary program with no dependencies.) I would assume jq to be a bit faster in this specific scope when compared to Python, but I wouldn't use it as a main argument for or against. Do you have other concerns I didn't have a chance to see? Thanks in advance and have a good day!
@@szymonstepniak hello! Well one thing I just found out is that jq can output csv with ‘@csv’ and I was wondering if you knew whether this was faster or slower. Like you said it doesn’t matter, I was already using jq to explore the data object so I ended up using it to clean the data and help me get it into a pandas data frame. It’s one line of code, compared to several for python. Cheers.
Need a video explaining how to use jq with bash variables. I want to use the variable looping through the array construct. [][${i}].desired_data. Loved the intro by the way. Very pragmatic.
Thanks for all of your videos, they are so impressive..! We are using a Global CI/CD pipeline in our environment for multiple application deployments. Can you please make a video on that using Jenkins groovy scripts? or please let me know if you have already created something similar already.
Thanks for your kind words! I can't promise anything - I haven't used Jenkins for more than a year, and I don't know if I will have enough time to re-invest into producing Jenkins-related content. We will see what the future brings :) Take care, and have a good day!
Thanks for your kind words, Mohammadreza! I learned jq by solving typical problems - I needed this tool in my Jenkins pipelines, I had specific requirements, and I just used the official manual to find a way how to met them stedolan.github.io/jq/manual/ Also, StackOverflow is a nice repository of use cases with interesting solutions that may help you learn even more about jq stackoverflow.com/questions/tagged/jq Happy learning and good luck!
this is really very helpful, i was looking for something really similar. Thanks, looking forward for your next video's. I have 1 query though, in you above example how would you get the top 3 records?
Hi, Anurag! If your curl response returns a JSON array and you want to limit the number of objects to e.g. 3, you can use jq's limit function. For instance, the curl command from the video (jobs.github.com/positions.json?description=java) returns 50 objects. If I want to get only the first 3 of them in an array, I can do: curl -s "jobs.github.com/positions.json?description=java" | jq '[limit(3; .[])]' And now I get the array of three first JSON objects instead of the original response returning 50 objects.
@@szymonstepniak ok . what am trying to achieve is, curl -s "jobs.github.com/positions.json?description=java" | jq '.[] | select(.type=="Full Time")' this will return me more than 1 result, so I want to add limit to the end result .. something like curl -s "jobs.github.com/positions.json?description=java" | jq '.[] | select(.type=="Full Time") | limit(3)' but this isn't working
@@anuragpugalia8462 To make the limit function work, you need to construct the array of objects first. Take a look at the output of the following command: jq '.[] | select(.type=="Full Time")' It produces separate JSON objects, not an array of elements. To create an array of objects, you need to wrap those two commands with square brackets: jq '[.[] | select(.type=="Full Time")]' Now it produces an array of JSON objects, and now you can pipe it with the limit instruction like this one: jq '[.[] | select(.type=="Full Time")] | [limit(3;.[])]' What you will get in result is an array of maximum 3 objects that matching the select condition.
Hey I really like your videos and I'm happy that it's giving me some knowledge :) thanks for sharing it. I would like to check if you make videos on Yaml, Jenkins, and Kubernetes integration.
This was helpful. It would be awesome if you made a part two, some more advanced usage/tips/tricks. Like matching on a property a few scopes deep like servers.$server_names.properties.location. Thanks!
Hello! Let me know if you liked this unusual intro 😁 I have a few more ideas for future videos, but I would love to hear your feedback. Thanks! 🙏
Liked it
very cool
it helped me a lot without loosing much time. The way how you recorded it, was also entertaining. I am interested in a video if you can filter the API or more videos with examples on filtering with jq. Dziekuje bardzo!
@@fleurdevries3121 Thanks for your kind words and sharing your ideas! Take care, and have a good day!
So "artistically" and for entertainment, outstanding (the intro). But for wanting to get to the content to "grab" what I was looking for, may cause frustration. Although, I was in that boat and did not get frustrated because I liked the intro and the quality of the footage REALLY stood out! So....take it for what its worth. 😅
Pierwsza "scena" cudo!! Fantasyczne wyjaśnienie, proste i do sedna. W 5 minut miałem rozwiązanie. Dzięki!!!
Dzięki wielkie za ciepłe słowa! Zawsze miło usłyszeć, że krótkie video pozwoliło zaoszczędzić sporo czasu :)
OMG thank you! I've been digging around the jq manual and other "searches" to find out how to return only the objects I want from the output!
Glad I could help! Take care, and have a good day!
Thank you 🙏 for putting together a wonderful training and easy to understand. Appreciate your time sir.
Thank you!
Love the intro and story telling ❤
And off course the video is on point
Thank you so much!! Take care, and hava a good day!
@@szymonstepniak you too ❤️
Just learned about json and I was having trouble understanding how it works untill I saw your video. Thank you very much!
Glad it helped you, Nuria! I plan to create a few more videos on jq in the near future. Stay tuned, and have a good day!
I saw jq when trying to debug jenkins console output and this video explained it well and concise. Thank you 🙂
Thanks for your kind words! Take care, and have a good day!
I really liked your methodology, practical and useful for daily tasks, it's usually all I need to do. Greetings from Brazil!
Thank you for your kind words, Rafael! Take care, and have a good day!
Mesej yang jelas, struktur yang jelas, mudah difahami, terima kasih
Thank you!
Ow I spent some time on search... but this video safe my life. Thanks!
I'm happy to hear you found this video helpful 😉 Take care, and have a good day!
Great video. Straight to the point!
Glad to hear that! Take care, and have a good day!
I recommend ijq as an interactive jq. Not only you get the output as you type, but it has autocompletion, so you don't have to study the input beforehand that much.
Thanks for sharing ijq in the comment - I haven't heard about it before. I'm gonna try it out the next time :) Take care, and have a good day!
JSON document I used in the video the link does not work anymore
Yes, Github has shutdown the Jobs API some time after publishing this video.
「あなたのコンテンツはとても感動的です」、
Nice! Very straight to the point. Easy to follow. Great intro to jq. Thanks!
I'm glad to hear you found this video useful, Giao! Take care, and have a good day!
Good evening sir, thank you for the knowledge. I want to ask, I have a log file that needs to be parsed and displayed, how to do it with jq? because the file extension is log not json
I'm not sure how to help you, Muhaammad. Log files usually consist of a different format than the JSON one. However, if your log file is a file that contains only valid JSON objects one under another, then you should be able to use it as an input for a jq (I haven't done anything like this, so I'm just guessing here.) But if your log file is not a valid JSON document (or documents), then there is nothing you can do.
@@szymonstepniak thanks for helping, I'm done with my case. I shouldn't have to pay attention to the file extension, because the contents are already json and can be parsed
How can I pick one single item from a list ? :/ Really scratching my head around this. Such a powerful tool surely must have a method to do it ?
It depends which element you want to pick from the list. You can use '.[n]' operator, where n is the index number. (E.g. "echo '[1,2,3,4]' | jq '.[0]'" => 1) Hope it helps. Take care, and have a good day!
I wish this video helped me but duplicating everything I saw only resulted in” Cannot index array with string name “X” no matter what I tried.
Solved. I needed .[] to be .data[]
Hi, Jay! Happy to hear you've figured it out. Have a good day!
@@j_holtslander I need it also, but can you explain why? Thank you in advance!
God bless u sir. Thank you very much
Thank you for your kind words!
This was very easy to understand. Also I did what you did in the beginning as well. Thank you!
Glad it helped! Have a good day!
That's an excellent video, thanks.
Thank you so much for your kind words! Take care, and have a good day!
So cool, this is best tool, better JOLT written on JAVA. For parsing any data source and resolve to change format this is fast and easy. Thank you for video!
Thanks a lot! I haven't heard about this JOLT, thanks for sharing the information. I will take a look at it out of curiosity, but I assume it cannot compete, as you mentioned, with the jq very well :) Good luck and happy hacking!
Szymon Stepniak, There is similar technology like this jmespath.org/specification.html too
Is jq faster than doing the same with a python script?
Hi Matthias! I think speed in this case is the least important thing you should focus on. If you are a Python developer and you already have a script that consumes some JSON and extracts interesting information, writing another such a script is a better choice. If you don't know Python and you don't want to install a general purpose programming language to do some JSON document transformations, jq is the tool that is designed just for this purpose (and it is a single binary program with no dependencies.) I would assume jq to be a bit faster in this specific scope when compared to Python, but I wouldn't use it as a main argument for or against. Do you have other concerns I didn't have a chance to see? Thanks in advance and have a good day!
@@szymonstepniak hello! Well one thing I just found out is that jq can output csv with ‘@csv’ and I was wondering if you knew whether this was faster or slower. Like you said it doesn’t matter, I was already using jq to explore the data object so I ended up using it to clean the data and help me get it into a pandas data frame. It’s one line of code, compared to several for python. Cheers.
Very informative your videos. Thanks a lot. Keep it up.
Thanks! You are very kind.
Loved the way you took us step by step starting from simple steps. Felt like having solved the problem with you live! 👏
Thanks for your kind words! Take care, and have a good day!
I use jq for a cli based random information generator
but I wanna filter the data more so this video was very helpful
I'm glad to hear that the video was helpful, Ram! Take care, and have a good day!
Need a video explaining how to use jq with bash variables. I want to use the variable looping through the array construct. [][${i}].desired_data. Loved the intro by the way. Very pragmatic.
Thanks for the kind words, Paul! I should publish another jq related video next week, I will try to do something with looping. Have a good day!
You try to give the video more brightness it will be great if you do
Thanks for the suggestion, Hoan! Take care, and have a good day!
Very helpful thanks.
You're welcome! Take care and have a good day!
yes more of jq content would be nice.
Thanks Shitiz, more jq videos soon :)
Very informative thanks for the video 😊
Glad it was helpful! There are two more jq related videos, here is the full playlist - th-cam.com/video/FSn_38gDvzM/w-d-xo.html Have a good day!
Thanks for all of your videos, they are so impressive..! We are using a Global CI/CD pipeline in our environment for multiple application deployments. Can you please make a video on that using Jenkins groovy scripts? or please let me know if you have already created something similar already.
Thanks for your kind words! I can't promise anything - I haven't used Jenkins for more than a year, and I don't know if I will have enough time to re-invest into producing Jenkins-related content. We will see what the future brings :) Take care, and have a good day!
@@szymonstepniak sure thank you..!
Waiting for your next video post :)
Thank you sir!
You are welcome!
Thanks, it was very useful. please share the reference which you've learned jq with us.
Thanks for your kind words, Mohammadreza! I learned jq by solving typical problems - I needed this tool in my Jenkins pipelines, I had specific requirements, and I just used the official manual to find a way how to met them stedolan.github.io/jq/manual/ Also, StackOverflow is a nice repository of use cases with interesting solutions that may help you learn even more about jq stackoverflow.com/questions/tagged/jq Happy learning and good luck!
Very useful. Thank you.
Thank you, Thomas, for the comment! I'm glad to hear this video was useful.
great tutorial
Thank you so much for your kind words, Alexandru! Take care, and have a good day!
The video sound is pretty good, beyond my imagination
Thanks for your kind words, Toan! Take care, and have a good day!
this is really very helpful, i was looking for something really similar. Thanks, looking forward for your next video's.
I have 1 query though, in you above example how would you get the top 3 records?
Hi, Anurag! If your curl response returns a JSON array and you want to limit the number of objects to e.g. 3, you can use jq's limit function. For instance, the curl command from the video (jobs.github.com/positions.json?description=java) returns 50 objects. If I want to get only the first 3 of them in an array, I can do:
curl -s "jobs.github.com/positions.json?description=java" | jq '[limit(3; .[])]'
And now I get the array of three first JSON objects instead of the original response returning 50 objects.
@@szymonstepniak ok . what am trying to achieve is,
curl -s "jobs.github.com/positions.json?description=java" | jq '.[] | select(.type=="Full Time")'
this will return me more than 1 result, so I want to add limit to the end result ..
something like
curl -s "jobs.github.com/positions.json?description=java" | jq '.[] | select(.type=="Full Time") | limit(3)'
but this isn't working
@@anuragpugalia8462 To make the limit function work, you need to construct the array of objects first. Take a look at the output of the following command:
jq '.[] | select(.type=="Full Time")'
It produces separate JSON objects, not an array of elements. To create an array of objects, you need to wrap those two commands with square brackets:
jq '[.[] | select(.type=="Full Time")]'
Now it produces an array of JSON objects, and now you can pipe it with the limit instruction like this one:
jq '[.[] | select(.type=="Full Time")] | [limit(3;.[])]'
What you will get in result is an array of maximum 3 objects that matching the select condition.
@@szymonstepniak got it. thanks a lot for such an instant reply . thats working . Really waiting for your next set of video's.
Just getting "Cannot index number with string" no matter what.
Thanks for th great video. curl is so yesterday's though :-). Give httpie a try, you won't regret
Thank you for your kind words, Albino! Yes, I love HTTPie! That's my go-to replacement for curl in 99% use cases :) Take care, and have a good day!
"made easy" sounds funny with that syntax ;)
Can't argue with that! 😆 Take care, and have a good day!
Great!
Thanks, Ben! Take care, and have a good day!
I love `jq`.
Same here, Colin :) Thanks for the comment! Check other two jq videos on my channel if you have time. Have a good day!
Hey I really like your videos and I'm happy that it's giving me some knowledge :) thanks for sharing it.
I would like to check if you make videos on Yaml, Jenkins, and Kubernetes integration.
Thank you for your kind words! I made a few videos on Jenkins already, more coming soon. Have a good day!
This was helpful. It would be awesome if you made a part two, some more advanced usage/tips/tricks. Like matching on a property a few scopes deep like servers.$server_names.properties.location. Thanks!
Stay tuned, I should finally find time to work on a few more episodes explaining some useful JQ tips and tricks. Take care, and have a good day!
intro mega 😂😂😂😂
Dzięki! :)
Into wasn't useful
Thanks for the feedback! Take care, and have a good day!
The image is too offensive
Thanks for your feedback, Kancha! Would you be so kind to explain what you find offensive, please? Thanks in advance! Take care, and have a good day!
Worst intro ever.
Thanks for your feedback, Fred! Take care, and have a good day!
i give you a quicktipp: less readme.md
「あなたのコンテンツはとても感動的です」、