[sophos] Fix add_locale handling in xg data stream - #15482
Conversation
- Fixed handling of time zones added by add_locale (which sets event.timezone) in the Sophos XG data stream. As add_locale will set the local timezone of the agent in event.timezone, this prevented the real time zone in the log from being set as there was a check to prevent event.timezone from being overridden. - Added a pipeline test to test this scenario
| { | ||
| "message": "<30>device=\"SFW\" date=2020-05-18 time=14:38:48 timezone=\"CEST\" device_name=\"XG230\" device_id=1234567890123456 log_id=041101618035 log_type=\"Anti-Spam\" log_component=\"SMTP\" log_subtype=\"Allowed\" status=\"\" priority=Information fw_rule_id=0 user_name=\"\" av_policy_name=\"None\" from_email_address=\"firewall@firewallgate.com\" to_email_address=\"Sysadmin@elasticuser.com\" email_subject=\"*ALERT* Sophos XG Firewall\" mailid=\"qkW2Y6-LxBk6U-vH-1590055245\" mailsize=19728 spamaction=\"QUEUED\" reason=\"Email has been accepted by Device and queued for scanning.\" src_domainname=\"elasticuser.com\" dst_domainname=\"\" src_ip=\"\" src_country_code=\"\" dst_ip=\"\" dst_country_code=\"\" protocol=\"TCP\" src_port=0 dst_port=0 sent_bytes=0 recv_bytes=0 quarantine_reason=\"Other\"\n", | ||
| "event": { | ||
| "timezone": "-05:00" |
There was a problem hiding this comment.
This simulates what is set by add_locale in filebeat.
🚀 Benchmarks reportTo see the full report comment with |
|
Pinging @elastic/integration-experience (Team:Integration-Experience) |
qcorporation
left a comment
There was a problem hiding this comment.
Looks good, approved.
Great that you add tags on the code that you touched.
Can you add a tag for the last set, where you removed the if statement
if: ctx.event?.timezone == null
Good catch! Added. |
💚 Build Succeeded
History
|
|
|
Package sophos - 3.15.3 containing this change is available at https://epr.elastic.co/package/sophos/3.15.3/ |
- Fixed handling of time zones added by add_locale (which sets event.timezone) in the Sophos XG data stream. As add_locale will set the local timezone of the agent in event.timezone, this prevented the real time zone in the log from being set as there was a check to prevent event.timezone from being overridden. - Added a pipeline test to test this scenario




Proposed commit message
Checklist
changelog.ymlfile.- [ ] I have verified that any added dashboard complies with Kibana's Dashboard good practicesHow to test this PR locally