# RabbitMQ and Zabbix Plugins

**URL:** <https://discuss.elastic.co/t/rabbitmq-and-zabbix-plugins/107057>\
**Category:** Logstash\
**Created:** [November 9, 2017, 2:43pm UTC](https://discuss.elastic.co/t/rabbitmq-and-zabbix-plugins/107057 "2017-11-09T14:43:09Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![demudrol](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/demudrol/32/24030_2.png) [@demudrol](https://discuss.elastic.co/u/demudrol)\
**Post date:** [November 9, 2017, 2:43pm UTC](https://discuss.elastic.co/t/rabbitmq-and-zabbix-plugins/107057/1 "2017-11-09T14:43:09Z")

</div>

Hi there!  
I've got two plugins:

- Rabbitmq input plugin
- Zabbix output plugin

Took some data from RabbitMQ and now i've got responseAnswer.Code filed.  
Now i want to send this filed to zabbix:

> ```
> if [type] == "ld.api.logger" {
> mutate {
> add_field => {
> "[@metadata][zabbix_key]" => "responseAnswer.Code"
> "zabbix_host" => "node4"
> "[@metadata][zabbix_value]" => "%{responseAnswer.Code}"
> }
> }
> }
> 
> ```

But in zabbix i see only:

> ```
> 09.11.2017 17:30:11	%{responseAnswer.Code}
> 09.11.2017 17:30:11	%{responseAnswer.Code}
> 09.11.2017 17:30:11	%{responseAnswer.Code}
> 09.11.2017 17:30:11	%{responseAnswer.Code}
> 09.11.2017 17:30:11	%{responseAnswer.Code}
> 09.11.2017 17:30:11	%{responseAnswer.Code}
> 
> ```

How to get value of this filed? Thanks a lot!

---

<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:** [November 9, 2017, 2:48pm UTC](https://discuss.elastic.co/t/rabbitmq-and-zabbix-plugins/107057/2 "2017-11-09T14:48:57Z")

</div>

If responseAnswer.Code is a nested field see [https://www.elastic.co/guide/en/logstash/current/event-dependent-configuration.html#logstash-config-field-references](https://www.elastic.co/guide/en/logstash/current/event-dependent-configuration.html#logstash-config-field-references) for the correct syntax.

---

<div class="post-metadata">

**Author:** ![demudrol](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/demudrol/32/24030_2.png) [@demudrol](https://discuss.elastic.co/u/demudrol)\
**Post date:** [November 9, 2017, 3:05pm UTC](https://discuss.elastic.co/t/rabbitmq-and-zabbix-plugins/107057/3 "2017-11-09T15:05:58Z")

</div>

Thank's for reply!  
How can i get from dev tools information about event and fields?

---

<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:** [November 9, 2017, 3:17pm UTC](https://discuss.elastic.co/t/rabbitmq-and-zabbix-plugins/107057/4 "2017-11-09T15:17:00Z")

</div>

> How can i get from dev tools information about event and fields?

What do you mean?

---

<div class="post-metadata">

**Author:** ![demudrol](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/demudrol/32/24030_2.png) [@demudrol](https://discuss.elastic.co/u/demudrol)\
**Post date:** [November 10, 2017, 6:54am UTC](https://discuss.elastic.co/t/rabbitmq-and-zabbix-plugins/107057/5 "2017-11-10T06:54:04Z")

</div>

thought that i could use something like this in dev tools in Kibana:

> `GET index/type/rabbit-*`

And saw structure of events with nested field...

So, how can i get this nested field? Thanks!

Another way, opened event in Kibana like JSON and saw this:

> ```
> "_source": {
> "responseAnswer": {
> "Code": 400,
> "Message": "{\"error\":\"invalid_grant\",\"error_description\":\"The user name or password is incorrect.\"}"
> },
> 
> ```

Made config like this:

> "[@metadata][zabbix\_value]" =\> "[\_source][responseAnswer][processingCode]"

And still no value in Zabbix =(

---

<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:** [November 13, 2017, 6:26am UTC](https://discuss.elastic.co/t/rabbitmq-and-zabbix-plugins/107057/6 "2017-11-13T06:26:18Z")

</div>

`[_source]` should _not_ be included here. Also, the subfield is `Code`, not `processingCode`.

---

<div class="post-metadata">

**Author:** ![demudrol](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/demudrol/32/24030_2.png) [@demudrol](https://discuss.elastic.co/u/demudrol)\
**Post date:** [November 13, 2017, 7:06am UTC](https://discuss.elastic.co/t/rabbitmq-and-zabbix-plugins/107057/7 "2017-11-13T07:06:06Z")

</div>

Now i got this in zabbix:

> 13.11.2017 09:59:20 [responseAnswer][processingCode]`

Maybe need to use something like this? [@metadata][responseAnswer][Code]?  
Dig deeper or something...

---

<div class="post-metadata">

**Author:** ![demudrol](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/demudrol/32/24030_2.png) [@demudrol](https://discuss.elastic.co/u/demudrol)\
**Post date:** [November 16, 2017, 11:38am UTC](https://discuss.elastic.co/t/rabbitmq-and-zabbix-plugins/107057/8 "2017-11-16T11:38:48Z")

</div>

Maybe any another suggestions?  
Thanks!

---

<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:** [December 14, 2017, 11:38am UTC](https://discuss.elastic.co/t/rabbitmq-and-zabbix-plugins/107057/9 "2017-12-14T11:38:53Z")

</div>

Closed on December 14, 2017, 11:38am UTC

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