-
Notifications
You must be signed in to change notification settings - Fork 438
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
azure logs: add ECS mapping for event.duration #11104
base: main
Are you sure you want to change the base?
Conversation
🚀 Benchmarks reportPackage
|
Data stream | Previous EPS | New EPS | Diff (%) | Result |
---|---|---|---|---|
signinlogs |
2450.98 | 2016.13 | -434.85 (-17.74%) | 💔 |
firewall_logs |
1694.92 | 1398.6 | -296.32 (-17.48%) | 💔 |
To see the full report comment with /test benchmark fullreport
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggest also
diff --git a/packages/azure/data_stream/activitylogs/elasticsearch/ingest_pipeline/default.yml b/packages/azure/data_stream/activitylogs/elasticsearch/ingest_pipeline/default.yml
index e5e7c52bbd..fcdc5b2eb3 100644
--- a/packages/azure/data_stream/activitylogs/elasticsearch/ingest_pipeline/default.yml
+++ b/packages/azure/data_stream/activitylogs/elasticsearch/ingest_pipeline/default.yml
@@ -72,10 +72,23 @@ processors:
field: azure.activitylogs.durationMs
target_field: event.duration
ignore_missing: true
+ - convert:
+ field: event.duration
+ tag: convert_event_duration
+ type: long
+ ignore_missing: true
+ on_failure:
+ - remove:
+ field: event.duration
+ - append:
+ field: error.message
+ value: 'Processor {{{_ingest.on_failure_processor_type}}} with tag {{{_ingest.on_failure_processor_tag}}} in pipeline {{{_ingest.pipeline}}} failed with message: {{{_ingest.on_failure_message}}}'
- script:
lang: painless
- source: if (ctx.event.duration!= null) {ctx.event.duration = ctx.event.duration
- * params.param_nano;}
+ source: >
+ if (ctx.event.duration != null) {
+ ctx.event.duration = ctx.event.duration * params.param_nano;
+ }
params:
param_nano: 1000000
ignore_failure: true
and changelog/manifest updates.
Hey @efd6, thanks for suggesting the I was looking for a temporarily quick fix for the mapping, adding back |
The field value must be a `long` to align with ECS and correctly leverage the ecs@mappings component template.
Quality Gate passedIssues Measures |
/test |
💔 Build Failed
Failed CI StepsHistory
cc @zmoog |
@@ -72,10 +72,23 @@ processors: | |||
field: azure.activitylogs.durationMs | |||
target_field: event.duration | |||
ignore_missing: true | |||
- convert: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't we adding back the mapping to ecs.yml instead of doing this ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree, we have seen that the conversion is not effective in communicating that the type should be a long.
Proposed commit message
Convert the
event.duration
field value to thelong
type.Users reported mapping exceptions due to
event.duration
string values causing field mapping askeyword
instead oflong
. See #10848 to learn more.Elasticsearch maps a field as a
keyword
if it has a string value. This happens even on stack versions 8.13+ because ecs@mappings does not perform type coercion.By converting the
event.duration
field values to thelong
type, we ensure Elasticsearch uses the expected ECS field mapping aslong
.Checklist
changelog.yml
file.Related issues