-
Notifications
You must be signed in to change notification settings - Fork 474
[Cisco IOS] Fix parsing when message_count is missing #6919
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 parsing when message_count is missing #6919
Conversation
Pinging @elastic/security-external-integrations (Team:Security-External Integrations) |
🌐 Coverage report
|
I have another format that I don't think is handled. It's coming from {
"event.original": [
"<190>3132517: 3132513: Jul 11 2023 18:38:06.203 UTC: %SEC-6-IPACCESSLOGP: list 110 denied tcp 10.100.18.5(53222) -> 10.100.16.35(7), 1 packet"
]
}
Related cisco config:
|
To get some more log diversity I enabled a few different origin ID options (the earlier sample was with
<190>3132811: sw01: 3132807: Jul 11 2023 19:30:44.575 UTC: %SEC-6-IPACCESSLOGRL: access-list logging rate-limited or missed 96 packets
|
I've tested them with this current change and all of them are ingested with no error, but some fields are not mapped well. I can extend the pattern of the grok processor to consider all these fields. I have just one concern with the last example
about how to differentiate a custom string with a hostname. |
5d02b23
to
ac5d025
Compare
I've added a new commit (ac5d0254c826180031ea541c5a6672916b41a9b1) trying to cover all the possibilities in the syslog header. However, I am still struggling with some use cases.
Apart from that, I think some new use cases are now handled, such as the parse of the syslog's timestamp and IP, or the possibility of having an asterisk before the timestamp when it may not be synchronized, as the documentation explains. |
ac5d025
to
3bf0b3d
Compare
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.
Including a custom string is also tricky to take into account since it is also parsed as a hostname.
I would treat the custom string value as a hostname. I think that its general purpose is the same, to identify the host.
packages/cisco_ios/data_stream/log/_dev/test/pipeline/test-syslog-header.log-expected.json
Outdated
Show resolved
Hide resolved
packages/cisco_ios/data_stream/log/_dev/test/pipeline/test-syslog-header.log-expected.json
Outdated
Show resolved
Hide resolved
packages/cisco_ios/data_stream/log/_dev/test/pipeline/test-syslog-header.log-expected.json
Outdated
Show resolved
Hide resolved
b1ba87a
to
e4e1649
Compare
packages/cisco_ios/data_stream/log/elasticsearch/ingest_pipeline/default.yml
Show resolved
Hide resolved
Hi @andrewkroh, I have already submitted all the changes we have talked about. |
0859cf5
to
6265ffc
Compare
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.
Other than the error.message suggestion, LGTM.
on_failure: | ||
- append: | ||
field: error.message | ||
value: 'Processor {{{_ingest.on_failure_processor_type}}} with tag fail-{{{_ingest.on_failure_processor_tag}}} in pipeline {{{_ingest.pipeline}}} failed with message: {{{_ingest.on_failure_message}}}' |
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.
Why is the real tag name prefixed with "fail-"? That seems misleading. If a user searches for that tag in the pipeline or the GET /_nodes/stats?metric=ingest&filter_path=nodes.*.ingest.pipelines
ingest stats data they won't find it.
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.
This is a design scar. I'll go through the a packages and remove them so we don't have a continuing source of precedent.
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.
Thanks for letting me know, I didn't realize that detail.
Package cisco_ios - 1.16.2 containing this change is available at https://epr.elastic.co/search?package=cisco_ios |
What does this PR do?
This pull request fixes a parsing error in the Cisco IOS integration when parsing an event with the format
<priority>TIMESTAMP|HOSTNAME
.Currently, the
grok
processor expects for themessage_count
field, which is optional so it could not come in the event.Checklist
changelog.yml
file.How to test this PR locally
Regarding this sample log:
It starts by a priority label but doesn't contain a message count before the timestamp and hostname. For this case, currently the ingest pipeline fails.
After the new pattern, the ingest pipeline is able to parse it properly.