# jq extracting properties to arrays from json row line

For example if we have a file that contains JSON object like

```
{"a": 1, "b":{"c": 11}
{"a": 2, "b":{"c": 22}}
{"a": 3, "b":{"c": 33}}
```

And you want to construct something like

```
["1", "11"]
["2", "22"]
["3", "33"]
```

You can do that with jq

```
$ cat filename.json | jq -c '[.a, .b.c]'
```

this is particularly usefull to grep something from JSON log


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://til.yulrizka.com/unix/jq-extracting-properties-to-arrays-from-json-row-line.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
