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

Why is id field dropped from message? #63

Closed
sapajune opened this issue Aug 28, 2020 · 6 comments
Closed

Why is id field dropped from message? #63

sapajune opened this issue Aug 28, 2020 · 6 comments
Labels

Comments

@sapajune
Copy link

I have message with id field and that was not being transmitted. Looking at code it indeed is deleted from message with comment that it is not possible to send id. Seemed kind of arbitrary restriction so I checked the GELF spec and it has no special meaning to field named id.

Tested modifying code to not drop the id and it worked perfectly so is there any real reason to drop the id field?

I'm using TCP output to send messages to Graylog 2.

@kkamkou
Copy link
Owner

kkamkou commented Aug 28, 2020

Your right. * in first versions of graylog-server it was not possible to send the id field.

@kkamkou kkamkou added the bug label Aug 28, 2020
@sapajune
Copy link
Author

Could this limitation be now removed or made an option then? I have use case where id field is necessary and I'd like to avoid doing extra mapping in both sender and Graylog.

@kkamkou
Copy link
Owner

kkamkou commented Aug 28, 2020

Are u sure that the id of a message is your custom one and not generated via UUID? (post a permalink url, please)

@kkamkou kkamkou added question and removed bug labels Aug 28, 2020
@sapajune
Copy link
Author

sapajune commented Aug 28, 2020

In the message I send id field contains UUID. In Graylog this shows up in id field and Graylog generated message id is unaffected. Seems to me it is working properly.

Cannot send permalink unfortunately. Here's screenshot.

image

Edit: To clarify, this is message that was sent with id allowed to pass through. Other messages don't have the id field at all.

@kkamkou
Copy link
Owner

kkamkou commented Aug 29, 2020

The "_id" is used as document ID to address the document in Elasticsearch.. Could you try to send two messages with the same id?
ref: https://github.com/Graylog2/graylog2-server/blob/35e06e2573ee08a72f391f68d6959bdfd285018d/graylog2-server/src/main/java/org/graylog2/plugin/Message.java#L75

@sapajune
Copy link
Author

As a workaround I resorted to send id field as messageId and copying it to id in Graylog end using extractor so this is not a show stopper for me anymore.

As I see it (on Graylog 2 and later at least) _id is separate from id field. I haven't explicitly checked but I'm quite sure also that it is possible to have multiple messages with same id field value (but not _id) since the use case actually does this - it reports several events related to one id.

@kkamkou kkamkou closed this as completed Aug 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants