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]: escape hyphen inside regex char list #9578

Merged
merged 1 commit into from
Apr 12, 2024

Conversation

pkoutsovasilis
Copy link
Contributor

@pkoutsovasilis pkoutsovasilis commented Apr 12, 2024

Proposed commit message

After tackling this issue, a respective PR was created to elastic-package to mainstream the detection of similar warnings. Thus this PR fixes the following similar to the former issue regex-related warning for cisco_ios

character class has '-' without escape

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

N/A

How to test this PR locally

Related issues

N/A

Screenshots

N/A

@elasticmachine
Copy link

🚀 Benchmarks report

To see the full report comment with /test benchmark fullreport

@pkoutsovasilis pkoutsovasilis force-pushed the pkoutsovasilis/fix_cisco_ios_regex_warnings branch from 042f979 to 3cea41e Compare April 12, 2024 11:21
Copy link

@elasticmachine
Copy link

💚 Build Succeeded

History

@pkoutsovasilis pkoutsovasilis changed the title Pkoutsovasilis/fix cisco ios regex warnings [cisco_ios]: escape hyphen inside regex char list Apr 12, 2024
@pkoutsovasilis pkoutsovasilis self-assigned this Apr 12, 2024
@pkoutsovasilis pkoutsovasilis added 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] labels Apr 12, 2024
@pkoutsovasilis pkoutsovasilis marked this pull request as ready for review April 12, 2024 11:49
@pkoutsovasilis pkoutsovasilis requested a review from a team as a code owner April 12, 2024 11:49
@elasticmachine
Copy link

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

@pkoutsovasilis
Copy link
Contributor Author

pkoutsovasilis commented Apr 12, 2024

@jrmolin @dwhyrock @taylor-swanson apparently if I don't escape the - in the char list and I move to the end right before the ] which is a special regex case and you don't have to escape the - benchmark results do not show a perf degradation 🥲

Copy link
Contributor

@gogochan gogochan left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@dwhyrock dwhyrock left a comment

Choose a reason for hiding this comment

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

That's a pretty interesting find. Nice work!

@taylor-swanson
Copy link
Contributor

@jrmolin @dwhyrock @taylor-swanson apparently if I don't escape the - in the char list and I move to the end right before the ] which is a special regex case and you don't have to escape the - benchmark results do not show a perf degradation 🥲

I'm actually surprised that this makes a difference. I knew about moving the hyphen to the end (which is what I typically do), but I would've assume that escaping it would've compiled to the same result.

@pkoutsovasilis pkoutsovasilis merged commit 2060587 into main Apr 12, 2024
5 checks passed
@pkoutsovasilis pkoutsovasilis deleted the pkoutsovasilis/fix_cisco_ios_regex_warnings branch April 12, 2024 13:57
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.

5 participants