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

cisco_ios: fix grok for ASR format logs #3694

Merged
merged 3 commits into from
Aug 22, 2022
Merged

cisco_ios: fix grok for ASR format logs #3694

merged 3 commits into from
Aug 22, 2022

Conversation

efd6
Copy link
Contributor

@efd6 efd6 commented Jul 13, 2022

What does this PR do?

This allows log lines emitted by ASR devices to be processed.

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.

Author's Checklist

  • [ ]

How to test this PR locally

Related issues

Screenshots

@elasticmachine
Copy link

elasticmachine commented Jul 13, 2022

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Start Time: 2022-08-10T06:42:46.646+0000

  • Duration: 18 min 23 sec

Test stats 🧪

Test Results
Failed 0
Passed 12
Skipped 0
Total 12

🤖 GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

@elasticmachine
Copy link

elasticmachine commented Jul 13, 2022

🌐 Coverage report

Name Metrics % (covered/total) Diff
Packages 100.0% (1/1) 💚
Files 100.0% (1/1) 💚 2.918
Classes 100.0% (1/1) 💚 2.918
Methods 100.0% (14/14) 💚 10.466
Lines 92.527% (260/281) 👍 0.949
Conditionals 100.0% (0/0) 💚

@@ -28,7 +28,7 @@ processors:
- grok:
field: _temp_.header
patterns:
- '^<%{NONNEGINT:log.syslog.priority:long}>%{NUMBER:event.sequence}?: (?:%{SYSLOGHOST:log.syslog.hostname}: )?%{CISCO_TIMESTAMP:_temp_.cisco_timestamp}'
- '^<%{NONNEGINT:log.syslog.priority:long}>%{NUMBER:event.sequence}?: (?:%{SYSLOGHOST:log.syslog.hostname}: )?(?:%{NUMBER:cisco.ios.sequence}: )?(%{CISCO_TIMESTAMP:_temp_.cisco_timestamp}|%{NOTSPACE:cisco.ios.uptime}:)'
Copy link
Member

Choose a reason for hiding this comment

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

The next line below uses event.sequence for what I think is the same value.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, I think that's probably right. It's not at all clear to me what is the appropriate way to deal with the potential complexity here. Depending on configuration, there are four ways that the log lines can be formatted wrt these sequence numbers, and depending on the history of the configuration (AFAICS) the sequence numbers may either agree or not. The choice that I made here to leave that alone was based on it being the only sequence number present, and so using it as the ECS field. In the case above, I have retained the Cisco event count as the sequence number to avoid confusion (rather than fixing it), and put the sequence number in the cisco.* fields in case it is wanted. The complexity here is discussed in the issue.

My conclusion was that so long as the user doesn't change their configuration for these numbers, things will work. So I was planning to add some documentation about how to configure them as a recommendation, with a caveat not to change it if they already are getting these values.

@efd6 efd6 marked this pull request as ready for review August 10, 2022 04:32
@efd6 efd6 requested a review from a team as a code owner August 10, 2022 04:32
@elasticmachine
Copy link

Pinging @elastic/security-external-integrations (Team:Security-External Integrations)

@efd6
Copy link
Contributor Author

efd6 commented Aug 10, 2022

/test

@efd6
Copy link
Contributor Author

efd6 commented Aug 15, 2022

I'll wait a bit to get feedback from @fgierlinger to see that the documentation here matches his experience with the device.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Integration:cisco_ios Cisco IOS
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Cisco IOS] ASR Log Format does not match grok pattern
3 participants