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

Unable to search using regular expressions when trying to filter graphs #4297

Closed
michaelwingender opened this issue Jun 10, 2021 · 6 comments
Labels
bug Undesired behaviour resolved A fixed issue
Milestone

Comments

@michaelwingender
Copy link

michaelwingender commented Jun 10, 2021

If you want to use a RegEx when filtering for Graphs in TreeView or Preview View, filters are not applied correctly. I don't see any results. I have graphs with with title "devicename has a bgp session" and many others. Up to 1.2.16 it was possible to see all the graphs with the filter "device.*bgp.*". Since 1.2.17 this is not possible any more.

I have found out that the changes that were applied in #4080 introduced the problem. After reverting the appropriate lines I can use RegEx as filter again. So the fix introduced another problem on my site.

@michaelwingender michaelwingender added bug Undesired behaviour unverified Some days we don't have a clue labels Jun 10, 2021
@michaelwingender michaelwingender changed the title RegEx not working Graph Filters RegEx not working in Graph Filters Jun 10, 2021
@TheWitness
Copy link
Member

Okay, verified. RegEx's are for tech's not DBA's ;)

@TheWitness TheWitness removed the unverified Some days we don't have a clue label Jun 25, 2021
@TheWitness TheWitness added this to the 1.2.18 milestone Jun 25, 2021
TheWitness added a commit that referenced this issue Jun 25, 2021
RegEx not working in Graph Filters
@TheWitness TheWitness added the resolved A fixed issue label Jun 25, 2021
@TheWitness
Copy link
Member

Should be working now.

@michaelwingender
Copy link
Author

Confirmed for "Preview View". It is working here. In "Tree View" it is not. Here preg_quote also needs to be removed to be able to use regex.

@netniV netniV closed this as completed Jun 30, 2021
@TheWitness TheWitness reopened this Jun 30, 2021
TheWitness added a commit that referenced this issue Jul 1, 2021
Missed one preg_quote() removal
@TheWitness
Copy link
Member

Okay, Tree view fixed as well now. Thanks!

@netniV netniV changed the title RegEx not working in Graph Filters Unable to search using regular expressions when trying to filter graphs Jul 4, 2021
@bernisys
Copy link
Contributor

Proposal:

I remember the preg_quote was added at some place in the code to fix a different other issue with using special chars (was it slashes or hashes or so?) in a search ... i found that pretty clumsy, as pointed out here, it destroys the use of regexes.

While I am definitely pro-regex (plus many colleagues as well), i still think this should be properly annotated in a pop-up, something like:

"If you want to search for special characters: (.... list ... ) you need to escape them by prefixing with a backslash ""

Anyways, thanks for bringing back the essential functionality ;)

@Kveri
Copy link

Kveri commented Oct 7, 2021

Hi, is this really fixed everywhere? I have 1.2.18 and I was unable to use regexp in graph search filter. I had to remove preg_quote from all lines in lib/html_tree.php

@github-actions github-actions bot locked and limited conversation to collaborators Jan 6, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Undesired behaviour resolved A fixed issue
Projects
None yet
Development

No branches or pull requests

5 participants