# Convert Text in JSON

**URL:** <https://discuss.elastic.co/t/convert-text-in-json/224604>\
**Category:** Logstash\
**Created:** [March 23, 2020, 6:59am UTC](https://discuss.elastic.co/t/convert-text-in-json/224604 "2020-03-23T06:59:58Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![brunus0475](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/brunus0475/32/66572_2.png) [@brunus0475](https://discuss.elastic.co/u/brunus0475)\
**Post date:** [March 23, 2020, 6:59am UTC](https://discuss.elastic.co/t/convert-text-in-json/224604/1 "2020-03-23T06:59:58Z")

</div>

Hi All,  
this is our stdout {} of Logstash:  
`{ "_index": "logstash","_type": "_doc","_id": "UPUcBnEBHL50VNrwHY-Q","_version": 1, "_score": null,"_source": {"host": {"name": "xxxxxx"},"@timestamp": "2020-03-23T06:37:16.915Z","data": {"node": "node1","level": "INFO", "timestamp": "2020-03-23T07:37:11,050","thread": "EthScheduler-Workers-3","throwable": "","class": "BlockPropagationManager","message": "Imported #979 / 0 tx / 0 om / 0 (0.0%) gas /(0xcbd404f6cec12eaecb9bed309b953fe5671ee868843807321772369b47756371) in 0.000s."}}`

We desire in ELS the "message" text field in "data" object :  
"message": "Imported #979 / 0 tx / 0 om / 0 (0.0%) gas / (0xcbd404f6cec12eaecb9bed309b953fe5671ee868843807321772369b47756371) in 0.000s."

in the JSON structured from below:  
`{Imported: 979,Tx: 0,Gas: 0 Hash:0xcbd404f6cec12eaecb9bed309b953fe5671ee868843807321772369b47756371,duration: 0,000s}`

Could you help us solve the problem?  
Thanks in advance  
BR

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [March 23, 2020, 2:57pm UTC](https://discuss.elastic.co/t/convert-text-in-json/224604/2 "2020-03-23T14:57:14Z")

</div>

> [@brunus0475](#):
>
> "Imported #979 / 0 tx / 0 om / 0 (0.0%) gas /(0xcbd404f6cec12eaecb9bed309b953fe5671ee868843807321772369b47756371) in 0.000s."

If that is your [message] field then either a dissect or a grok filter should be able to extract the fields you want.

---

<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:** [April 20, 2020, 2:57pm UTC](https://discuss.elastic.co/t/convert-text-in-json/224604/3 "2020-04-20T14:57:21Z")

</div>

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