Skip to content

Fix panic due to no type#4331

Merged
andrewkroh merged 2 commits intoelastic:masterfrom
tsg:fix_panic_logstash_output
May 17, 2017
Merged

Fix panic due to no type#4331
andrewkroh merged 2 commits intoelastic:masterfrom
tsg:fix_panic_logstash_output

Conversation

@tsg
Copy link
Copy Markdown
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
Copy Markdown
Contributor Author

tsg commented May 17, 2017

jenkins, test it again

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown

urso commented May 17, 2017

Can we have a BC-breaking changelog entry?

Copy link
Copy Markdown
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