# Regex for json format

**URL:** <https://discuss.elastic.co/t/regex-for-json-format/121635>\
**Category:** Logstash\
**Created:** [February 27, 2018, 11:01am UTC](https://discuss.elastic.co/t/regex-for-json-format/121635 "2018-02-27T11:01:07Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![shrikantgulia](https://avatars.discourse-cdn.com/v4/letter/s/c68b51/32.png) [@shrikantgulia](https://discuss.elastic.co/u/shrikantgulia)\
**Post date:** [February 27, 2018, 11:01am UTC](https://discuss.elastic.co/t/regex-for-json-format/121635/1 "2018-02-27T11:01:07Z")

</div>

Hello  
I am using the logstash to seprate the json format  
can someone suggest me the regex.  
as i want to seprate all the names after "have" and it may contain as many names  
and with a common format i want to extract all the names

a help would be really appreciated

Json format: {"haves": ["rahul", "ankit", "D33y", "SSoin", "Raman"],

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [February 27, 2018, 11:14am UTC](https://discuss.elastic.co/t/regex-for-json-format/121635/2 "2018-02-27T11:14:56Z")

</div>

Use a json filter to parse JSON strings. Never regexes.

---

<div class="post-metadata">

**Author:** ![shrikantgulia](https://avatars.discourse-cdn.com/v4/letter/s/c68b51/32.png) [@shrikantgulia](https://discuss.elastic.co/u/shrikantgulia)\
**Post date:** [February 27, 2018, 11:20am UTC](https://discuss.elastic.co/t/regex-for-json-format/121635/3 "2018-02-27T11:20:19Z")

</div>

Hello Magnus  
Thankyou fro the reply

How should i proceed  
pls give me a sample code

Regards  
Shrikant

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [February 27, 2018, 12:03pm UTC](https://discuss.elastic.co/t/regex-for-json-format/121635/4 "2018-02-27T12:03:21Z")

</div>

The json filter documentation contains an example of how it can be used.

---

<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:** [March 27, 2018, 12:03pm UTC](https://discuss.elastic.co/t/regex-for-json-format/121635/5 "2018-03-27T12:03:37Z")

</div>

Closed on March 27, 2018, 12:03pm UTC

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