Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unserializers raw => Make me fail? #105

Closed
janober opened this issue Jun 4, 2015 · 2 comments
Closed

Unserializers raw => Make me fail? #105

janober opened this issue Jun 4, 2015 · 2 comments

Comments

@janober
Copy link

janober commented Jun 4, 2015

Just started to play around with node-logstash. But was totally unable to read from rabbitMQ. No matter what I did it was never able to parse the data.

After looking through the code I think I found now the issue. For me it looks like that the unserializer "raw" (which is the one I need) can not work at all. Currently it says in the code:

BaseInput.prototype.unserialize_data_raw = function(data, ok_callback, parse_fail_callback) {
  parse_fail_callback(data);
};

So with other words: "No matter what you give me I fail" which is the exact opposite of what I would have expected.

Should it not call "ok_callback" instead?

@bpaquet
Copy link
Owner

bpaquet commented Jun 5, 2015

RabbitMQ is only a transport. You can use raw or json_logstash format
through it. If you use raw, you loose metadata (original timestamp,
filename origin, host origin ...).

You have to use the same format to RabbitMQ and from RabbitMQ.

The code for raw format is correct : it always fail to parse data, because
we want no data parsing, only raw data.

On Thu, Jun 4, 2015 at 2:16 AM, Jan notifications@github.com wrote:

Just started to play around with node-logstash. But was totally unable to
read from rabbitMQ. No matter what I did it was never able to parse the
data.

After looking through the code I think I found now the issue. For me it
looks like that the unserializer "raw" (which is the one I need) can not
work at all. Currently it says in the code:

BaseInput.prototype.unserialize_data_raw = function(data, ok_callback, parse_fail_callback) {
parse_fail_callback(data);
};

So with other words: "No matter what you give me I fail" which is the
exact opposite of what I would have expected.

Should it not call "ok_callback" instead?


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

@janober
Copy link
Author

janober commented Jun 5, 2015

Thanks for the explanation of raw! Turned out that the problem why "json_logstash" did not work was that I had no "@timestamp" attribute.
So close...

@janober janober closed this as completed Jun 5, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants