Elasticsearch: Fix processing of raw_data with not-recognized time format #78262
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is pretty much the same as #67767 where we fixed processing of
logs
queries with not-recognized time format. At that time, I did not realized that this is going to be an issue forraw_data
queries as well. Therefore in this PR, we are fixing processing of unrecognized time formats forraw_data
queries. Forraw_document
queries this is not needed as we are not parsing time field.More detailed information:
This is a bug fix for processing time field in ES on backend, when time field uses format that golang does not recognize (e.g. MM/DD/YYY, unix timestamp with nanoseconds decimal point, ...). To fix this for
raw_data
queries, we are usingfields
to get time field instrict_date_optional_time_nanos
format that is recognizable by golang and also supports nanosecond precision.To test this:
make devenv sources=elastic
enableElasticsearchBackendQuerying
is set totrue
https://localhost:9200
and for time field add@timestamp_custom
.raw_data
query - you should not seenull
values in time column@timestamp
,@timestamp_unix
,@timestamp_nanos
to ensure all formats work as expected.Fixed:
Current main (broken):
Fixes: #77114