Skip to content

Commit

Permalink
[ML] Use event.timezone instead of beat.timezone in file upload (#58447
Browse files Browse the repository at this point in the history
…) (#58463)

This is because beat.timezone was renamed to event.timezone in
elastic/beats#9458

The corresponding file structure finder change is
elastic/elasticsearch#52720
  • Loading branch information
droberts195 authored Feb 25, 2020
1 parent f13cb92 commit 48c0c29
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -148,17 +148,17 @@ function populateFailures(error, failures, chunkCount) {
}
}

// The file structure endpoint sets the timezone to be {{ beat.timezone }}
// The file structure endpoint sets the timezone to be {{ event.timezone }}
// as that's the variable Filebeat would send the client timezone in.
// In this data import function the UI is effectively performing the role of Filebeat,
// i.e. doing basic parsing, processing and conversion to JSON before forwarding to the ingest pipeline.
// But it's not sending every single field that Filebeat would add, so the ingest pipeline
// cannot look for a beat.timezone variable in each input record.
// Therefore we need to replace {{ beat.timezone }} with the actual browser timezone
// cannot look for a event.timezone variable in each input record.
// Therefore we need to replace {{ event.timezone }} with the actual browser timezone
function updatePipelineTimezone(ingestPipeline) {
if (ingestPipeline !== undefined && ingestPipeline.processors && ingestPipeline.processors) {
const dateProcessor = ingestPipeline.processors.find(
p => p.date !== undefined && p.date.timezone === '{{ beat.timezone }}'
p => p.date !== undefined && p.date.timezone === '{{ event.timezone }}'
);

if (dateProcessor) {
Expand Down

0 comments on commit 48c0c29

Please sign in to comment.