# Can Logstash accepts JMX object name of wildcards?

**URL:** <https://discuss.elastic.co/t/can-logstash-accepts-jmx-object-name-of-wildcards/52680>\
**Category:** Logstash\
**Created:** [June 14, 2016, 2:07am UTC](https://discuss.elastic.co/t/can-logstash-accepts-jmx-object-name-of-wildcards/52680 "2016-06-14T02:07:36Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![natarajan\_k](https://avatars.discourse-cdn.com/v4/letter/n/f14d63/32.png) [@natarajan\_k](https://discuss.elastic.co/u/natarajan_k)\
**Post date:** [June 14, 2016, 2:07am UTC](https://discuss.elastic.co/t/can-logstash-accepts-jmx-object-name-of-wildcards/52680/1 "2016-06-14T02:07:36Z")

</div>

i am collecting the metrics from kafka through logstash and storing it in elastic search.

basically, i can able to collect the server metrics from kafka but metrics of producer and consumer is not working.

below are my kafka configuration:  
producer.properties:  
metadata.broker.list=publicipaddr:9093,publicipaddr:9094  
producer.type=sync  
serializer.class=kafka.serializer.DefaultEncoder  
client.id=logstash

consumer.properties:  
zookeeper.connect=privateipaddr:2181  
group.id=logst-test  
client.id=logstash  
auto.offset.reset=largest

i could able to send and receive messages by executing the producer and consumer like below:  
bin/kafka-console-producer.sh --broker-list publicipaddr:9093,publicipaddr:9094 --sync --topic test1  
bin/kafka-console-consumer.sh --zookeeper privateipaddr:2181 --topic test1 --from-beginning --consumer.config config/consumer.properties

my client id and group id is listed while executing:  
bin/kafka-consumer-groups.sh --zookeeper privateipaddr:2181 --list  
logstash  
logst-test

i have specified client id and group id different since i dont know how this works while listening to logstash. so, i have given different name to be listed in groups.

below is my logstash metrics which i have defined in /etc/logstash/jmx folder:  
{  
"host" : "publicipaddr",  
"port" : 9997,  
"alias" : "kafka\_1\_jvm",  
"queries" : [  
{  
"object\_name" : "kafka.producer:type=producer-metrics,clientId=${client\_id}",  
"object\_alias" : "kafka\_producer\_4"  
},{  
"object\_name" : "kafka.consumer:type=ConsumerFetcherManager,name=MaxLag,clientId=logstash,broker=0",  
"object\_alias" : "kafka\_producer\_2"  
}  
]  
}

i have tried with different possibilities of clientId value like:  
1.clientId=${client\_id}  
2.clientId=logstash  
3.clientId=logst-test  
4.clientId=([-.\w]+)

whenever i run the logstash:  
bin/logstash agent -f /etc/logstash/conf.d/jmx\_kafka.conf --debug --verbose

i get the same error message, i dont see metrics coming from kafka:  
(1,2,3).No jmx object found for kafka.producer:type=producer-metrics,client-id=${client\_id} {:level=\>:warn}  
4.unrecognised token \w

i am badly struck. please help me

appreciated.

---

<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 6, 2017, 4:53am UTC](https://discuss.elastic.co/t/can-logstash-accepts-jmx-object-name-of-wildcards/52680/2 "2017-07-06T04:53:15Z")

</div>

Closed on July 6, 2017, 4:53am UTC


