# How to read property name which is inside JSON for alert?

**URL:** <https://discuss.elastic.co/t/how-to-read-property-name-which-is-inside-json-for-alert/240051>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-alerting\
**Created:** [July 6, 2020, 6:42pm UTC](https://discuss.elastic.co/t/how-to-read-property-name-which-is-inside-json-for-alert/240051 "2020-07-06T18:42:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![gunjan\_prmr](https://avatars.discourse-cdn.com/v4/letter/g/ed655f/32.png) [@gunjan\_prmr](https://discuss.elastic.co/u/gunjan_prmr)\
**Post date:** [July 6, 2020, 6:42pm UTC](https://discuss.elastic.co/t/how-to-read-property-name-which-is-inside-json-for-alert/240051/1 "2020-07-06T18:42:47Z")

</div>

I am able pull the specific index infor by using `ctx.results.0.hits.hits.0._source.log`. This gives me desired result. Now this comes a JSON blob where I want to read particular property but not sure it is possible or not.

i.e. `ctx.results.0.hits.hits.0._source.log` gives me below object. I want to extract value of `time` or `remote_addr` from here. How can I do that?

`"{ \"time\": \"2020-07-06T18:16:19+00:00\", \"remote_addr\": \"3.216.137.196\",\"x-forward-for\": \"12.189.103.34, 64.252.128.90, 3.216.137.196\", \"remote_user\":\"\", \"bytes_sent\": 99, \"request_time\": 0.007, \"status\":200, \"vhost\": \"api.a.rids.sit.tce.tillster.com\", \"request_proto\": \"HTTP/1.1\", \"request_query\": \"\", \"request_length\": 880, \"duration\": 0.007,\"method\": \"POST\", \"http_referrer\": \"\", \"http_user_agent\":\"Amazon CloudFront\" }\n"`

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [July 23, 2020, 9:33am UTC](https://discuss.elastic.co/t/how-to-read-property-name-which-is-inside-json-for-alert/240051/2 "2020-07-23T09:33:20Z")

</div>

Try `ctx.results.0.hits.hits.0._source.time`

---

<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:** [August 20, 2020, 9:33am UTC](https://discuss.elastic.co/t/how-to-read-property-name-which-is-inside-json-for-alert/240051/3 "2020-08-20T09:33:30Z")

</div>

Closed on August 20, 2020, 9:33am UTC

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