Skip to content

[panw] Update event.created field to follow ECS spec - #10731

Merged
mjwolf merged 8 commits into
elastic:mainfrom
mjwolf:panw-event-created
Aug 15, 2024
Merged

[panw] Update event.created field to follow ECS spec#10731
mjwolf merged 8 commits into
elastic:mainfrom
mjwolf:panw-event-created

Conversation

@mjwolf

@mjwolf mjwolf commented Aug 7, 2024

Copy link
Copy Markdown
Contributor

Proposed commit message

The ECS spec states event.created should be the time the event is first seen by the agent or ingested. The panw integration was not following this, and was instead setting it to the PANOS event timestamp.

This corrects the integration to follow ECS properly.

These field changes have been made:

  • event.created is set from filebeat's initial timestamp (before modification by the syslog processor or ingest pipeline).
  • panw.panos.received_time is now defined as the PANOS log timestamp (it is the same value that was previous in event.created)
  • panw.panos.generated_time is added to hold the PANOS generated time
  • @timestamp now holds the panw.panos.high_resolution_timestamp value, or if it isn't available panw.panos.received_time

This is also a major version upgrade, because of these changed field definitions.

Checklist

  • I have reviewed tips for building integrations and this pull request is aligned with them.
  • I have verified that all data streams collect metrics or logs.
  • I have added an entry to my package's changelog.yml file.
  • I have verified that Kibana version constraints are current according to guidelines.
The ECS spec states `event.created` should be the time the event is
first seen by the agent or ingested. The panw integration was not following this,
and was instead setting it to the PANOS event timestamp.

This corrects the integration to follow ECS properly. `event.created` is now set by the
filebeat @timestamp, which is the time the agent first sees the event.

The PANOS timestamp is still available in the `panw.panos.received_time` field.
@mjwolf
mjwolf requested a review from a team as a code owner August 7, 2024 22:10
@mjwolf mjwolf self-assigned this Aug 7, 2024
@elasticmachine

Copy link
Copy Markdown

🚀 Benchmarks report

To see the full report comment with /test benchmark fullreport

@andrewkroh andrewkroh added Integration:panw Palo Alto Next-Gen Firewall Team:Security-Deployment and Devices DEPRECATED Deployment and Devices Security team [elastic/sec-deployment-and-devices] labels Aug 8, 2024
@elasticmachine

Copy link
Copy Markdown

Pinging @elastic/sec-deployment-and-devices (Team:Security-Deployment and Devices)

Comment thread packages/panw/data_stream/panos/elasticsearch/ingest_pipeline/default.yml Outdated
@mjwolf
mjwolf force-pushed the panw-event-created branch 2 times, most recently from 65d6e81 to 96aed05 Compare August 8, 2024 21:33
* Don't set event.created field, this is added by filebeat when it receives the event.
* Set '@timestamp' to be set from received_time, if high_resolution_timestamp is not available.
@mjwolf
mjwolf force-pushed the panw-event-created branch from 96aed05 to 5c32971 Compare August 8, 2024 21:39
@mjwolf
mjwolf requested a review from a team August 12, 2024 18:24
"category": [
"configuration"
],
"created": "2021-10-25T20:25:39.000-04:00",

@taylor-swanson taylor-swanson Aug 14, 2024

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're losing event.created here. I think we need to copy the initial @timestamp to event.created at the beginning of the pipeline to fix this.

mjwolf added 2 commits August 15, 2024 12:34
Set event.created in one of the first filebeat processors, before syslog processor.

`event.created` needs to be set in filebeat, since it's defined as the time filebeat/agent
first processes the event. It also needs to be set before the syslog processor, since syslog
will set the timestamp to the log message's timestamp.
@mjwolf
mjwolf enabled auto-merge (squash) August 15, 2024 20:23
@elasticmachine

Copy link
Copy Markdown

💚 Build Succeeded

History

cc @mjwolf

@mjwolf
mjwolf merged commit 7e37f1c into elastic:main Aug 15, 2024
@elasticmachine

Copy link
Copy Markdown

Package panw - 4.0.0 containing this change is available at https://epr.elastic.co/search?package=panw

@mjwolf
mjwolf deleted the panw-event-created branch August 15, 2024 21:52
harnish-crest-data pushed a commit to chavdaharnish/integrations that referenced this pull request Feb 4, 2025
The [ECS spec states](https://www.elastic.co/guide/en/ecs/current/ecs-event.html#field-event-created) `event.created` should be the time the event is first seen by the agent or ingested. The panw integration was not following this and was instead setting it to the PANOS event timestamp.

This corrects the integration so that it follows ECS properly.

These field changes have been made:
* `event.created` is set from filebeat's initial timestamp (before modification by the syslog processor or ingest pipeline).
*  `panw.panos.received_time` is now defined as the PANOS log timestamp (it is the same value that was previous in `event.created`)
* `panw.panos.generated_time` is added to hold the PANOS generated time
* `@timestamp` now holds the `panw.panos.high_resolution_timestamp` value, or if it isn't available `panw.panos.received_time`

This is also a major version upgrade, because of these changed field definitions.
harnish-crest-data pushed a commit to chavdaharnish/integrations that referenced this pull request Feb 5, 2025
The [ECS spec states](https://www.elastic.co/guide/en/ecs/current/ecs-event.html#field-event-created) `event.created` should be the time the event is first seen by the agent or ingested. The panw integration was not following this and was instead setting it to the PANOS event timestamp.

This corrects the integration so that it follows ECS properly.

These field changes have been made:
* `event.created` is set from filebeat's initial timestamp (before modification by the syslog processor or ingest pipeline).
*  `panw.panos.received_time` is now defined as the PANOS log timestamp (it is the same value that was previous in `event.created`)
* `panw.panos.generated_time` is added to hold the PANOS generated time
* `@timestamp` now holds the `panw.panos.high_resolution_timestamp` value, or if it isn't available `panw.panos.received_time`

This is also a major version upgrade, because of these changed field definitions.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking change Integration:panw Palo Alto Next-Gen Firewall Team:Security-Deployment and Devices DEPRECATED Deployment and Devices Security team [elastic/sec-deployment-and-devices]

4 participants