# Logstash-grok unable to identify process from \`ps -ef/cmdline/metricbeat\`

**URL:** <https://discuss.elastic.co/t/logstash-grok-unable-to-identify-process-from-ps-ef-cmdline-metricbeat/115172>\
**Category:** Logstash\
**Created:** [January 11, 2018, 8:47pm UTC](https://discuss.elastic.co/t/logstash-grok-unable-to-identify-process-from-ps-ef-cmdline-metricbeat/115172 "2018-01-11T20:47:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jamesliu\_london](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jamesliu_london/32/38602_2.png) [@jamesliu\_london](https://discuss.elastic.co/u/jamesliu_london)\
**Post date:** [January 11, 2018, 8:47pm UTC](https://discuss.elastic.co/t/logstash-grok-unable-to-identify-process-from-ps-ef-cmdline-metricbeat/115172/1 "2018-01-11T20:47:36Z")

</div>

I've used MetricBeat6.1 with Logstash6.1-grok.

* * *

This is a grok attempt to identify all the processes and categorize them. These are mainly Identified [java\_apps],[unidentified\_java\_apps] and [general unidentified apps] using the system.process.cmdline from metricbeat.

But its all appearing as getting themselves tagged as 'Unidentified'.

* * *

grok {  
match =\> {"system.process.cmdline" =\> [  
"^%{GREEDYDATA:datanode} org.apache.hadoop.hdfs.server.datanode.DataNode$",  
"^%{GREEDYDATA:ambari\_server} org.apache.ambari.server.controller.AmbariServer$",  
"^%{GREEDYDATA:unidentified\_java}/bin/java%{GREEDYDATA}$",  
"^%{GREEDYDATA:unidentified}$"  
]}  
}

if [datanode] {  
mutate {  
replace =\> { "message" =\> "%{datanode}" }  
add\_tag =\> ["DataNode"]  
}  
} else if [ambari\_server] {  
mutate {  
replace =\> { "message" =\> "%{ambari\_server}" }  
add\_tag =\> ["Ambari\_server"]  
}  
} else {  
mutate {  
add\_tag =\> ["Unidentified"]  
}  
}  
}

* * *

Am I supposed to use:

- "system.process.cmdline" ?
- "[@metadata][system][process][cmdline]"
- "[\_source][system][process][cmdline]"

- this bit was answered by [Grok filter not working](https://discuss.elastic.co/t/grok-filter-not-working/86239)

---

<div class="post-metadata">

**Author:** ![jamesliu\_london](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jamesliu_london/32/38602_2.png) [@jamesliu\_london](https://discuss.elastic.co/u/jamesliu_london)\
**Post date:** [January 12, 2018, 2:01pm UTC](https://discuss.elastic.co/t/logstash-grok-unable-to-identify-process-from-ps-ef-cmdline-metricbeat/115172/2 "2018-01-12T14:01:17Z")

</div>

answered by [Grok filter not working](https://discuss.elastic.co/t/grok-filter-not-working/86239)  
[system][process][cmdline]

---

<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:** [February 9, 2018, 2:02pm UTC](https://discuss.elastic.co/t/logstash-grok-unable-to-identify-process-from-ps-ef-cmdline-metricbeat/115172/3 "2018-02-09T14:02:52Z")

</div>

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