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

Fix panic due to no type #4331

Merged
merged 2 commits into from
May 17, 2017
Merged

Conversation

tsg
Copy link
Contributor

@tsg tsg commented May 17, 2017

Some Beats no longer add a "type", but the LS output was still requiring it.
This hardcodes the type in @metadata to doc, to keep BWC with older Logstashes/configs.

It also removes "type" from a few kafka integration tests, to make sure we don't depend
on it.

Some Beats no longer add a "type", but the LS output was still requiring it.
This hardcodes the type in `@metadata` to `doc`, to keep BWC with older Logstashes/configs.

It also removes `"type"` from a few kafka integration tests, to make sure we don't depend
on it.
@tsg
Copy link
Contributor Author

tsg commented May 17, 2017

jenkins, test it again

Copy link
Contributor

@exekias exekias left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WFG

typ := event["type"].(string)
buf.WriteString(`"@metadata":{"type":`)
encodeString(buf, typ)
buf.WriteString(`"@metadata":{"type":"doc","beat":`)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if there is a type like we have in packetbeat? I think it is ok to just have it outside the meta info.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, i think it's safer to hardcode the metadata one to doc, as otherwise existing Logstash configs will put it in _type.

@urso
Copy link

urso commented May 17, 2017

Can we have a BC-breaking changelog entry?

Copy link
Contributor

@ruflin ruflin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WFG

@andrewkroh andrewkroh merged commit 97de042 into elastic:master May 17, 2017
@tsg tsg mentioned this pull request Jul 24, 2017
28 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants