I have a requirement to query and filter for an exact string with nothing more.
The messages has the exact string what I am looking for and some message has more text next to it, but I want to filter for only the string I am looking for.
Any way around this?
Thank You,
How to query for exact string with nothing more?
-
- Posts: 252
- Joined: Wed Dec 14, 2016 12:30 pm
Re: How to query for exact string with nothing more?
Here's a good tutorial on the syntax for Lucene query.
http://www.lucenetutorial.com/lucene-query-syntax.html
However, if you just need to filter out messages with that additional text, and that additional text is reliable, you can put this in your query.
http://www.lucenetutorial.com/lucene-query-syntax.html
However, if you just need to filter out messages with that additional text, and that additional text is reliable, you can put this in your query.
Code: Select all
message: "I want this" -message: "But not this"
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Be sure to check out our Knowledgebase for helpful articles and solutions!
-
- Posts: 252
- Joined: Wed Dec 14, 2016 12:30 pm
Re: How to query for exact string with nothing more?
Thanks @mbellerue.
What is I have a lot of messages that I want to filter out?
Here is an example:
Messages:
- NagiosXI Enterprise Server and Network Monitoring Software NagiosXI
- NagiosXI is Enterprise Server and Network Monitoring Software
- NagiosXI
If I have to filter the messages that has just "NagiosXI" and nothing more?
What is I have a lot of messages that I want to filter out?
Here is an example:
Messages:
- NagiosXI Enterprise Server and Network Monitoring Software NagiosXI
- NagiosXI is Enterprise Server and Network Monitoring Software
- NagiosXI
If I have to filter the messages that has just "NagiosXI" and nothing more?
Re: How to query for exact string with nothing more?
It's not a perfect solution for sure. For your exact example, you can look for common words. If you wanted just the NagiosXI message, you could do this,
Since both of the other messages have Enterprise in them, they should be stopped by the second part of the filter.
Code: Select all
message: "NagiosXI" -message: "Enterprise"
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Be sure to check out our Knowledgebase for helpful articles and solutions!
-
- Posts: 252
- Joined: Wed Dec 14, 2016 12:30 pm
Re: How to query for exact string with nothing more?
Thanks @mbellerue.
This may not necessarily help with my requirement, but may be to an extent.
Does this "-message" accept wild cards?
This may not necessarily help with my requirement, but may be to an extent.
Does this "-message" accept wild cards?
Re: How to query for exact string with nothing more?
Yes, it will do wildcards.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Be sure to check out our Knowledgebase for helpful articles and solutions!
-
- Posts: 252
- Joined: Wed Dec 14, 2016 12:30 pm