add ability to prefix log lines with a.. prefix.#15
add ability to prefix log lines with a.. prefix.#15jonphilpott wants to merge 1 commit intomxenabled:masterfrom
Conversation
| end | ||
|
|
||
| logger << json_payload + $INPUT_RECORD_SEPARATOR | ||
| logger << (prefix.nil? ? "" : prefix) + json_payload + $INPUT_RECORD_SEPARATOR |
There was a problem hiding this comment.
prefix.to_s will work here since nil.to_s #=> "".
There was a problem hiding this comment.
This might actually be a bit problematic since the expectation is that the output is a pure json blob without any formatting or parsing required.
There was a problem hiding this comment.
the idea we were discussing was that prefixing the blob with a prefix would allow us to positively identify logstasher output in a stdout stream without having to fully parse the json
There was a problem hiding this comment.
Won't this break logstash filters that try to parse a json payload?
filter {
json {
source => "message"
}
}
There was a problem hiding this comment.
if someone defines a prefix then the logstash pipeline will extract the json string after the prefix to a field and then json parse on that new field.
No description provided.