# What is a JSON object?

**URL:** <https://discuss.elastic.co/t/what-is-a-json-object/378453>\
**Category:** Beats\
**Created:** [May 23, 2025, 4:48am UTC](https://discuss.elastic.co/t/what-is-a-json-object/378453 "2025-05-23T04:48:32Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![yuswanul](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/yuswanul/32/101662_2.png) [@yuswanul](https://discuss.elastic.co/u/yuswanul)\
**Post date:** [May 23, 2025, 4:48am UTC](https://discuss.elastic.co/t/what-is-a-json-object/378453/1 "2025-05-23T04:48:32Z")

</div>

Hi everyone,

Sorry to ask a very basic question. At first, I'm trying to find a way to parse a JSON log in filebeat with container input type. Then I found this [documentation](https://www.elastic.co/guide/en/beats/filebeat/8.18/filebeat-input-container.html#filebeat-input-container-config-json). in the description, it said it only works if there is 1 json object per line

> Filebeat processes the logs line by line, so the JSON decoding only works if there is one JSON object per line.

so I ended up with a question, `"What is a JSON object?"` After doing some research, I found out that JSON object is determined by curly braces `{}`. If so, what are `Bio` and `place` called in this example?

`{"Bio":{"male":{"name":"trou"}},"place":{"live":"city"}}`

I thought `Bio` and `place` were a JSON object all this time

I really appreciate your explanation.

thank you

---

<div class="post-metadata">

**Author:** ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)\
**Post date:** [May 23, 2025, 5:55am UTC](https://discuss.elastic.co/t/what-is-a-json-object/378453/2 "2025-05-23T05:55:22Z")

</div>

> [@yuswanul](#):
>
> I thought `Bio` and `place` were a JSON object all this time

Both are members in the json object, a pair of names and values. [[rfc definition](https://datatracker.ietf.org/doc/html/rfc8259#section-4)]

A json object starts with `{` and ends with `}`, in this case your json object is:

```auto
{"Bio":{"male":{"name":"trou"}},"place":{"live":"city"}}

```

Which looks like this when pretty printed:

```auto
{
  "Bio": {
    "male": {
      "name": "trou"
    }
  },
  "place": {
    "live": "city"
  }
}

```

What the line you quoted from the Filebeat documentation means is that for it to decode JSON you need to have one object per line.

This works:

```auto
{"Bio":{"male":{"name":"trou"}},"place":{"live":"city"}}

```

But this does not work:

```auto
{"Bio":{"male":{"name":"trou"}},"place":{"live":"city"}}, {"Bio":{"male":{"name":"trou"}},"place":{"live":"city"}}

```

In the first one you have one json objects, in the second one you have two json objects separated by a comma.

---

<div class="post-metadata">

**Author:** ![yuswanul](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/yuswanul/32/101662_2.png) [@yuswanul](https://discuss.elastic.co/u/yuswanul)\
**Post date:** [May 23, 2025, 6:01am UTC](https://discuss.elastic.co/t/what-is-a-json-object/378453/3 "2025-05-23T06:01:49Z")

</div>

> [@leandrojmp](#):
>
> Both are members in the json object, a pair of names and values

so instead of calling them a JSON object, I should call them `object` only. correct?
