# How can i get "Elasticsearch Filter Plugin" result in json list in C#

**URL:** <https://discuss.elastic.co/t/how-can-i-get-elasticsearch-filter-plugin-result-in-json-list-in-c/133788>\
**Category:** Logstash\
**Created:** [May 30, 2018, 4:45am UTC](https://discuss.elastic.co/t/how-can-i-get-elasticsearch-filter-plugin-result-in-json-list-in-c/133788 "2018-05-30T04:45:16Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![yaser](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/yaser/32/109240_2.png) [@yaser](https://discuss.elastic.co/u/yaser)\
**Post date:** [May 30, 2018, 4:45am UTC](https://discuss.elastic.co/t/how-can-i-get-elasticsearch-filter-plugin-result-in-json-list-in-c/133788/1 "2018-05-30T04:45:16Z")

</div>

hi every one , i have a query like this in my logstash "elasticsearch plugin " :

**here is the logstash config file ::**

```
if[type] == "mytype"
	{
		elasticsearch
		{
				hosts => ["192.168.1.1:9200"]
				index => "my_index"
				query_template => "myQuery.json"
		fields => 
			{ 		
                      "id" => "find_id",	                     		
			  "@timestamp" => "find_@timestamp" 
			} 
		}
	}

```

**and this one is myQuery.json file ::**

```
{
  "query": {
    "match_all": {}
   }
}

```

**and the issue is my result ::**

> "find\_id": [1,2,3,4,5,6,7,8,9,10]
> 
> "find\_@timestamp":\> ["2018-05-28T05:28:13.117Z", "2018-05-28T05:39:24.493Z", "2018-05-28T05:39:49.463Z", "2018-05-28T05:49:15.383Z", "2018-05-28T06:55:56.366Z", "2018-05-28T08:21:00.996Z", "2018-05-28T08:21:26.024Z", "2018-05-28T05:43:38.502Z", "2018-05-28T05:43:47.080Z", "2018-05-28T05:48:55.364Z"]

**I want to get result to get that way :**

**{["find\_id":"1",@timestamp: 2018-05-28T05:49:15.383Z, other fields],**  
**["find\_id":"2",@timestamp: 2018-03-22T05:49:15.383Z, other fields]}**

**_how can i get this result from" logstash elasticsearch filter plugin "_**

---

<div class="post-metadata">

**Author:** ![yaser](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/yaser/32/109240_2.png) [@yaser](https://discuss.elastic.co/u/yaser)\
**Post date:** [June 9, 2018, 5:56pm UTC](https://discuss.elastic.co/t/how-can-i-get-elasticsearch-filter-plugin-result-in-json-list-in-c/133788/2 "2018-06-09T17:56:46Z")

</div>

any comment ??????????

---

<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:** [June 9, 2018, 9:45pm UTC](https://discuss.elastic.co/t/how-can-i-get-elasticsearch-filter-plugin-result-in-json-list-in-c/133788/3 "2018-06-09T21:45:57Z")

</div>

I cannot think off the top of my head how to get that, but this would give you an array of arrays.

```auto
    ruby { code => "
        i = event.get('find_id')
        t = event.get('find_@timestamp')
        a = []
        i.each_index { |k|
            n = [i[k], t[k] ]
            a << n
        }
        event.set('arrayOfArrays', a)
        "
    }

```

---

<div class="post-metadata">

**Author:** ![yaser](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/yaser/32/109240_2.png) [@yaser](https://discuss.elastic.co/u/yaser)\
**Post date:** [June 16, 2018, 7:02am UTC](https://discuss.elastic.co/t/how-can-i-get-elasticsearch-filter-plugin-result-in-json-list-in-c/133788/4 "2018-06-16T07:02:26Z")

</div>

tHANK yOU sO mUCH !

---

<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:** [July 14, 2018, 7:02am UTC](https://discuss.elastic.co/t/how-can-i-get-elasticsearch-filter-plugin-result-in-json-list-in-c/133788/5 "2018-07-14T07:02:29Z")

</div>

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