-
Notifications
You must be signed in to change notification settings - Fork 307
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
Survive attempts at indexing events that don't have a @timestamp #777
Conversation
Note that if the index doesn't require a timestamp to resolve, events are let through. Closes logstash-plugins#739.
Prior to this PR, the following crashes Logstash with a
After this PR, Logstash simply skips the event, and logs this instead:
|
Poll:
Is fixing a crash a breaking change? 😂 |
Thanks for working on this, I agree this is a bad experience +1 to improving it! But I think this could be part of a broader discussion:
Concerning 1, I think you are right, so many use cases don't need it. |
I agree that Logstash's string interpolation for timestamp could be made to not raise an exception. I think there are already tickets for this. This PR fixes a Logstash crash today for LS 5.x and 6.x users, though. |
Looking at the code around DLQ, I see metrics being tracked for each type of outcome for an event. My PR here does not do that. This potentially needs to be discussed. Or perhaps we can simply introduce such a metric in #772 and fix this crash today. |
After multiple discussions on the subject elsewhere, let’s remind ourselves that this PR is about fixing a crash today for all users of 5.x and 6.x. Whether or not we eventually prevent the removal of Let’s try to discuss only the merits of this PR in whether it solves the crash in a good way or if needs improvements. |
@webmat I think I'd prefer this to remain a situation where logstash crashes fatally. Logstash expects that any event will have |
@jsvd What about people importing semi-static CSVs (e.g. zip codes) with Logstash? Should these have a Is this requirement documented anywhere? Finally, is this a hard requirement for the Logstash => ES scenario only, or should any Logstash configuration (even when it doesn't talk to ElasticSearch) have this hard requirement? |
A long time ago About documentation, we didn't do a good job there at all. That said, I'm up for discussing if we should have a version 2 where we drop this requirement for [edit] link to issue about documenting event api elastic/logstash#8662 |
Gotcha. Should I close this PR, or repurpose it to output a slightly more explicit message when either are missing? The following has the merit of complaining about the missing timestamp:
But this message will not stop people from contacting support and saying Logstash is crashing. It doesn't make clear that this is crashing because missing So perhaps we could literally output a message that says both The point of this would be to prevent needless support and SDH activity. Note that with the discussions I had last week, I was under the impression that requiring Here's another idea, though (based on #718). We could also consider sending events missing a |
++ on improving messaging when this happens. We can catch this error and print a much nicer error message like "An event without
My perspective here is that anytime this situation happens it was by user configuration (e.g. using mutate/remove) so the reaction we want is for this to be solved asap. With this in mind, probably DLQ'ing isn't ideal, wdyt? |
maybe we can create a new PR and refer to this one as the discussion that led to it. |
New issue created: #779. Let's move the discussion there. |
are unaffected and are still indexed, whether or not they have a
@timestamp
.@timestamp
are destined to a timestamped index name,we don't send them for indexing, and we log an error.
#event_action_tuple
now returns nil when an event is discarded this way.require the full plugin to be tested.
This prevents a full Logstash crash, and closes #739
Update
After multiple discussions on the subject elsewhere, let’s remind ourselves that this PR is about fixing a crash today for all users of 5.x and 6.x.
Whether or not we eventually prevent the removal of
@timestamp
in a future breaking change (in LS 7.0 or later) is orthogonal to this.Let’s try to discuss only the merits of this PR in whether it solves the crash in a good way or if needs improvements.