Mastering jq: with the help of AI


TLDR1

 

jq has been a challenging tool for me for quite some time. As humans, we still struggle with handling API responses.

Like many developers, I too have encountered difficulties with the syntax of jq. I strongly believe this tool is powerful but not for humans. 🙂

Although gron2 has long been considered a more user-friendly tool, it falls short in comparison to jq.

When doing my work , I prefer using tools that align well with my thought process and make it easier to create scenarios that improve life.

To free up more time, I have been contemplating which tasks I should delegate or assign to AI, and one area where I strongly believe. Writing jq rules is the one of them.

 

 

AI + jq + gron = ❤️❤️❤️

 

 

Let’s explain the problem to the AI.

Problem

I want to find whole clusters which has any UNHEALTY status.

 

Search one cluster name which I know


 

Find possible statuses for the health

 

Explain everything to the AI!!

This is my API structure

Write me jq command if collectorHealthStatus or admissionControlHealthStatus or scannerHealthStatus or overallHealthStatus or sensorHealthStatus not equal to HEALTY print .name

Result is here!!

 

2. Advantages of using this

  • We don’t give whole json which contains unnecessary information3
  • No Typo!! 4
  • This way allow us to automate everything easily