# Output values into a Json dictionary

**URL:** <https://discuss.elastic.co/t/output-values-into-a-json-dictionary/271919>\
**Category:** Logstash\
**Created:** [May 3, 2021, 12:36am UTC](https://discuss.elastic.co/t/output-values-into-a-json-dictionary/271919 "2021-05-03T00:36:26Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ElasticLiver](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/elasticliver/32/64869_2.png) [@ElasticLiver](https://discuss.elastic.co/u/ElasticLiver)\
**Post date:** [May 3, 2021, 12:36am UTC](https://discuss.elastic.co/t/output-values-into-a-json-dictionary/271919/1 "2021-05-03T00:36:26Z")

</div>

I get the following values from a database:

```auto
1234 , first 1, 123 ,third

```

and I want to output them as a json dictionary to a file

```auto
"1234" => {"key1" => "first 1" "key2" => 123 "key3" => "third 1"}

```

i can do this with codec line and format, but still wil be missing the curly bracket that open and close the entire json file:

```auto
**{**
      "1234" => {"key1" => "first 1" "key2" => 123 "key3" => "third 1"}
      "5678" => {"key1" => "first 2" "key2" => 456 "key3" => "third 2"}
**}**

```

is there a way to do this

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [May 31, 2021, 12:36am UTC](https://discuss.elastic.co/t/output-values-into-a-json-dictionary/271919/2 "2021-05-31T00:36:33Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
