# Not able to create the filter with correct pattern

**URL:** <https://discuss.elastic.co/t/not-able-to-create-the-filter-with-correct-pattern/205956>\
**Category:** Logstash\
**Created:** [October 30, 2019, 10:33pm UTC](https://discuss.elastic.co/t/not-able-to-create-the-filter-with-correct-pattern/205956 "2019-10-30T22:33:35Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bharath\_Pusuluri](https://avatars.discourse-cdn.com/v4/letter/b/b9bd4f/32.png) [@Bharath\_Pusuluri](https://discuss.elastic.co/u/Bharath_Pusuluri)\
**Post date:** [October 30, 2019, 10:33pm UTC](https://discuss.elastic.co/t/not-able-to-create-the-filter-with-correct-pattern/205956/1 "2019-10-30T22:33:35Z")

</div>

input file -  
{"apps":{"app":[{"id":"application\_1571691267503\_939654","user":"Z013J5W","name":"HIVE-d9904734e7fa7249f0","queue":"default","state":"RUNNING","finalStatus":"UNDEFINED","progress":55.259087}],"logAggregationStatus":"NOT\_START","unmanagedApplication":false,"amNodeLabelExpression":""}

filter using like below. Something worked when I used 5.2 now I am with 7.2. I am getting warning saying "[WARN] 2019-10-30 17:19:02.329 [[main]\>worker49] split - Only String and Array types are splittable. field:apps is of type = Hash" and nothing is ingested in Elasticsearch.

filter {  
json {  
source =\> "message"  
}  
split { field =\> "[apps]" }  
split { field =\> "[apps][app]" }  
}

---

<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:** [October 30, 2019, 11:04pm UTC](https://discuss.elastic.co/t/not-able-to-create-the-filter-with-correct-pattern/205956/2 "2019-10-30T23:04:57Z")

</div>

> [@Bharath\_Pusuluri](#):
>
> split { field =\> "[apps]" }

As it says, [apps] is not an array so you cannot do this. Remove that line.

However, that should not prevent the event being indexed. Are there any errors in the elasticsearch logs?

---

<div class="post-metadata">

**Author:** ![Bharath\_Pusuluri](https://avatars.discourse-cdn.com/v4/letter/b/b9bd4f/32.png) [@Bharath\_Pusuluri](https://discuss.elastic.co/u/Bharath_Pusuluri)\
**Post date:** [October 30, 2019, 11:16pm UTC](https://discuss.elastic.co/t/not-able-to-create-the-filter-with-correct-pattern/205956/3 "2019-10-30T23:16:04Z")

</div>

Hi Badger,

Issue is resolved by removing the first [apps] and data is correctly loading with the following changes.

filter {  
json {  
source =\> "message"}  
split { field =\> "[apps][app]" }  
split { field =\> "[apps][app][resourceRequests]" }  
}

Now I have a problem  
I want to load only few values to elasticsearch output.. How to specify that specific values?  
Reason : I am getting huge data as part of resource Requests and it is the big hurdle to load the data, so I want to cut it down while loading.

---

<div class="post-metadata">

**Author:** ![Bharath\_Pusuluri](https://avatars.discourse-cdn.com/v4/letter/b/b9bd4f/32.png) [@Bharath\_Pusuluri](https://discuss.elastic.co/u/Bharath_Pusuluri)\
**Post date:** [October 31, 2019, 3:00pm UTC](https://discuss.elastic.co/t/not-able-to-create-the-filter-with-correct-pattern/205956/4 "2019-10-31T15:00:40Z")

</div>

filter worked -  
split {remove\_field =\> "apps.app.resourceRequests"}

---

<div class="post-metadata">

**Author:** ![Bharath\_Pusuluri](https://avatars.discourse-cdn.com/v4/letter/b/b9bd4f/32.png) [@Bharath\_Pusuluri](https://discuss.elastic.co/u/Bharath_Pusuluri)\
**Post date:** [October 31, 2019, 3:16pm UTC](https://discuss.elastic.co/t/not-able-to-create-the-filter-with-correct-pattern/205956/5 "2019-10-31T15:16:38Z")

</div>

I want to remove multiple fields, which is not working..

split {remove\_field =\> ["apps.app.resourceRequests","apps.app.resourceRequests.capability","apps.app.resourceRequests.resourceName","apps.app.resourceRequests.relaxLocality","apps.app.trackingUrl","command","apps.app.amContainerLogs","apps.app.amNodeLabelExpression","tags"]}

Actually, I have a lot of data to parse. This particular logstash script not loading. Not able to find any log...even logstash also not showing anything

---

<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:** [November 28, 2019, 3:16pm UTC](https://discuss.elastic.co/t/not-able-to-create-the-filter-with-correct-pattern/205956/6 "2019-11-28T15:16:38Z")

</div>

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