# How to read JSON string in message field

**URL:** <https://discuss.elastic.co/t/how-to-read-json-string-in-message-field/235167>\
**Category:** Elasticsearch\
**Created:** [June 1, 2020, 12:47pm UTC](https://discuss.elastic.co/t/how-to-read-json-string-in-message-field/235167 "2020-06-01T12:47:48Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ankit\_S](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ankit_s/32/69148_2.png) [@Ankit\_S](https://discuss.elastic.co/u/Ankit_S)\
**Post date:** [June 1, 2020, 12:47pm UTC](https://discuss.elastic.co/t/how-to-read-json-string-in-message-field/235167/1 "2020-06-01T12:47:48Z")

</div>

Hello,

I have a message field having JSON string I need to filter records based on that keys of that JSON.  
Following is my message field having JSON string

"\_source": {  
"@timestamp": "2020-06-01T11:30:01.081Z",  
"level": "info",  
"message": "Published 'position update' message to ESB for CorrelationId: 29c35f2e-721f-456e-b61b-de5698df01c8, Message: {"Provider":"hutch","ShipmentKey":"444444","CorrelationId":"44444-721f-456e-b61b-de5698df01c8","Latitude":4455,"Longitude":-4444,"UpdateDateUtc":"2020-05-31T21:41:32.000Z","OriginalUpdate":"{\"Bearing\":173,\"DriverName\":\"Gaurav Dhammi\",\"Latitude\":49.20196,\"LoadStatus\":\"Active\",\"LocationAddress\":\"5545/45 110 Ave,\",\"LocationDate\":\"2020-05-31 21:41:32\",\"Longitude\":-122.877204,\"PlateNo\":\"53086P\",\"UnitNo\":\"184\",\"VIN\":\"1FUJHHDR6LLKU5076\"}"}",  
"label": "tracking.consumer.esb",  
"hostName": "4444",  
"provider": "hutch",

I want to create dashboard where I want to show all ShipmentKey based on the provider name selected i.e. hutch. Shipment key is in message field as JSON form  
How do I filter documents and show shipmentkeys based on the provider selected in Kibana Control option list?  
I tried scripted field but as per requirement I can not create separate field as it shows as extra field to existing logs

Can you please help  
Thanks

---

<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:** [June 29, 2020, 12:47pm UTC](https://discuss.elastic.co/t/how-to-read-json-string-in-message-field/235167/2 "2020-06-29T12:47:51Z")

</div>

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