Skip to content
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

[Filebeat][Fortinet] Remove pre populated event.timezone #20273

Merged
merged 3 commits into from
Jul 30, 2020

Conversation

marc-gr
Copy link
Contributor

@marc-gr marc-gr commented Jul 28, 2020

What does this PR do?

Removes the pre populated event.timezone field.

Why is it important?

Some fortinet logs do not have a tz field to set as event.timezone, for this reason, when this happens, the event.timezone was incorrectly set to the system default instead of UTC or none (which represents UTC).

With this change event.timezone will only be set when the log has a timezone itself.

Checklist

- [ ] My code follows the style guidelines of this project
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [ ] I have made corresponding change to the default configuration files

  • I have added tests that prove my fix is effective or that my feature works
  • I have added an entry in CHANGELOG.next.asciidoc or CHANGELOG-developer.next.asciidoc.

How to test this PR locally

cd x-pack/filebeat
TESTING_FILEBEAT_MODULES=fortinet mage pythonIntegTest

@elasticmachine
Copy link
Collaborator

Pinging @elastic/siem (Team:SIEM)

@botelastic botelastic bot added needs_team Indicates that the issue/PR needs a Team:* label and removed needs_team Indicates that the issue/PR needs a Team:* label labels Jul 28, 2020
@elasticmachine
Copy link
Collaborator

elasticmachine commented Jul 28, 2020

💚 Build Succeeded

Pipeline View Test View Changes Artifacts preview

Expand to view the summary

Build stats

  • Build Cause: [Pull request #20273 updated]

  • Start Time: 2020-07-29T11:17:01.239+0000

  • Duration: 50 min 56 sec

Test stats 🧪

Test Results
Failed 0
Passed 2434
Skipped 385
Total 2819

Copy link
Member

@andrewkroh andrewkroh left a comment

Choose a reason for hiding this comment

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

I think event.timezone is being populated by the module with the beats add_locale processor. So if the field needs to be removed then we should remove this processor so that the field is never set with the wrong value.

@marc-gr
Copy link
Contributor Author

marc-gr commented Jul 29, 2020

I think event.timezone is being populated by the module with the beats add_locale processor. So if the field needs to be removed then we should remove this processor so that the field is never set with the wrong value.

Good catch, will change it, thanks!

@adriansr
Copy link
Contributor

So if I understand this correctly, Fortinet logs may or may not have a tz. If the tz is there, ingested dates will be relative to that. If it isn't, with this change, we'll assume dates are GMT. Before this change, dates were interpreted as local to the system running Filebeat.

I don't think this is a good or bad idea, just that we might find customers with different needs.

At some point we need to review how the modules behave regarding timezones and possibly add a common setting (var.tz or similar) to control how dates are interpreted when tz is not known.

@marc-gr
Copy link
Contributor Author

marc-gr commented Jul 30, 2020

So if I understand this correctly, Fortinet logs may or may not have a tz. If the tz is there, ingested dates will be relative to that. If it isn't, with this change, we'll assume dates are GMT. Before this change, dates were interpreted as local to the system running Filebeat.

Exactly that

I don't think this is a good or bad idea, just that we might find customers with different needs.

At some point we need to review how the modules behave regarding timezones and possibly add a common setting (var.tz or similar) to control how dates are interpreted when tz is not known.

I agree, there is this new ticket to add this possibility to fortinet #20300, maybe could be changed to extend this option more generally.

@marc-gr marc-gr merged commit b1b7860 into elastic:master Jul 30, 2020
@marc-gr marc-gr deleted the fix_fortinet_timezone branch July 30, 2020 12:31
marc-gr added a commit to marc-gr/beats that referenced this pull request Jul 30, 2020
* Remove pre populated event.timezone

* Add changelog entry

* Remove  processor instead of the field

(cherry picked from commit b1b7860)
@marc-gr marc-gr added the v7.9.0 label Jul 30, 2020
marc-gr added a commit to marc-gr/beats that referenced this pull request Jul 30, 2020
* Remove pre populated event.timezone

* Add changelog entry

* Remove  processor instead of the field

(cherry picked from commit b1b7860)
marc-gr added a commit that referenced this pull request Jul 30, 2020
…0348)

* Remove pre populated event.timezone

* Add changelog entry

* Remove  processor instead of the field

(cherry picked from commit b1b7860)
marc-gr added a commit that referenced this pull request Jul 30, 2020
…0347)

* Remove pre populated event.timezone

* Add changelog entry

* Remove  processor instead of the field

(cherry picked from commit b1b7860)
v1v added a commit to v1v/beats that referenced this pull request Jul 30, 2020
…ne-2.0

* upstream/master:
  [Elastic Agent] Add skeleton for client/server for agent control protocol (elastic#20163)
  Auditbeat: Allow multiple instances by grouping kprobes by PID (elastic#20325)
  [Filebeat][Fortinet] Remove pre populated event.timezone (elastic#20273)
v1v added a commit to v1v/beats that referenced this pull request Jul 31, 2020
…allation

* upstream/master:
  Check expand_event_list_from_field when json in map[string]interface{} format (elastic#20370)
  [docs] Remove deprecated security roles (elastic#20162)
  Modify doc in app_insights metricset (elastic#20185)
  [Elastic Agent] Add skeleton for client/server for agent control protocol (elastic#20163)
  Auditbeat: Allow multiple instances by grouping kprobes by PID (elastic#20325)
  [Filebeat][Fortinet] Remove pre populated event.timezone (elastic#20273)
  Add an explicit system test for processes on unix systems (elastic#20320)
melchiormoulin pushed a commit to melchiormoulin/beats that referenced this pull request Oct 14, 2020
* Remove pre populated event.timezone

* Add changelog entry

* Remove  processor instead of the field
leweafan pushed a commit to leweafan/beats that referenced this pull request Apr 28, 2023
…) (elastic#20347)

* Remove pre populated event.timezone

* Add changelog entry

* Remove  processor instead of the field

(cherry picked from commit 61b0730)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants