Skip to content

[cisco_ios] Improve hostname parsing #13816

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

mjwolf
Copy link
Contributor

@mjwolf mjwolf commented May 7, 2025

Proposed commit message

Improves parsing of hostnames, to allow hostnames that begin with digits. This is not strictly allowed by the Cisco IOS specification, but it is commonly allowed on systems. So support for it should be added.

Due to the limitations of the grok parser's regex support, and the many possible formats of Cisco IOS logs, this required using a script to do some additional processing. With leading digits allowed in hostnames, they can appear to be sequence numbers, which can appear in the exact same location in the logs as hostname, and are also all digits. Forward look-ahead to check that there's any letter in the hostname pattern doesn't work to solve this, since the look-ahead cannot be contained to groups. Instead the script used to find this case, after grok.

Additionally there is another log format, when using year-first date stamps, the year can be mistaken sequence number. This also removes sequence number, if it appears that it was mistakenly taken from a timestamp.

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.
  • I have verified that any added dashboard complies with Kibana's Dashboard good practices

@mjwolf mjwolf requested a review from a team as a code owner May 7, 2025 04:22
@mjwolf mjwolf added enhancement New feature or request Integration:cisco_ios Cisco IOS bug Something isn't working, use only for issues and removed enhancement New feature or request labels May 7, 2025
@elasticmachine
Copy link

💚 Build Succeeded

@andrewkroh andrewkroh added the Team:Security-Deployment and Devices Deployment and Devices Security team [elastic/sec-deployment-and-devices] label May 7, 2025
@elasticmachine
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working, use only for issues Integration:cisco_ios Cisco IOS Team:Security-Deployment and Devices Deployment and Devices Security team [elastic/sec-deployment-and-devices]
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants