bpaquet/node-logstash

"type" parameter in AMQP is not added to the message when used with rabbitmq

tomkregenbild opened this issue · 6 comments

I am able to send messages to rabbitmq and everything is working great except for the "type" parameter that is missing from the payload that is getting to the rabbitmq server.

In the node-logstash configuration I added the following:
&type=syslog

In rabbitMQ I see the following payload:
{"message":"Jan 21 14:27:30 test","path":"/var/log/syslog","host":"SERVERNAME","@timestamp":"2015-01-21T14:26:31.044Z","@Version":"1"}

From the documentation I expect there to be a key of "type":"syslog"

Am I missing something?

Do you have overriden the serializer ? Are you using the default one ?

On Wed, Jan 21, 2015 at 3:36 PM, Tom Kregenbild notifications@github.com
wrote:

I am able to send messages to rabbitmq and everything is working great
except for the "type" parameter that is missing from the payload that is
getting to the rabbitmq server.

In the node-logstash configuration I added the following:
&type=syslog

In rabbitMQ I see the following payload:
{"message":"Jan 21 14:27:30
test","path":"/var/log/syslog","host":"OPERATIONAL-85-US1-TestAgent","
@timestamp https://github.com/timestamp":"2015-01-21T14:26:31.044Z","
@Version https://github.com/version":"1"}

From the documentation I expect there to be a key of "type":"syslog"

Am I missing something?


Reply to this email directly or view it on GitHub
#89.

No, I am using the default one.

Strange :

I ran node-logstash with the following command

bin/node-logstash-agent output://stdout://
"input://amqp://localhost:5672?exchange_name=toto&type=syslog"

And post your payload in a message in toto exchange in rabbitmq admin
console

I get

[STDOUT] {

"message": "Jan 21 14:27:30 test",

"path": "/var/log/syslog",

"host": "OPERATIONAL-85-US1-TestAgent",

"@timestamp": "2015-01-21T14:26:31.044Z",

"@Version": "1",

"type": "syslog"

}

May be your url is wrong ? Parameter must be concatenated with &, not with
? (I did the error during my test).

On Wed, Jan 21, 2015 at 9:01 PM, Tom Kregenbild notifications@github.com
wrote:

No, I am using the default one.


Reply to this email directly or view it on GitHub
#89 (comment)
.

I used & but used it with the output and not with the input as in your example.

Hmm. Sorry. The docs is wrong. Type parameters are only in input plugins.

Can you put the type param on inputs ? Or use the compute_field filter to
add it ?

On Wed, Jan 21, 2015 at 9:11 PM, Tom Kregenbild notifications@github.com
wrote:

I used & but used it with the output and not with the input as in your
example.


Reply to this email directly or view it on GitHub
#89 (comment)
.

I'll try to use the compute_field filter tomorrow and I'll update you, thank you for all the help.