Splunk Search

i have 40 use cases to evaluate status or incidents in a log file? What programming approch should i follow, how can i use CASE statement here?

alfiyashaikh
New Member

I have 40 usecases.
I have 800+ incidents in incident log file
Every inicident should be evaluated by these 40 usecases, and relative feedback should be added to the report .
1 incident can have 1 or more than 1 feedback depending on how many usecases turn out to be true.

Tags (1)
0 Karma
1 Solution

gcusello
SplunkTrust
SplunkTrust

Hi alfiyashaikh,
use a lookup to manage all your patterns to search:
if you have to search a value in a field, use this

your_search [ | inputlookup my_patterns.csv | table field ]
| ...

field name must be the same in search.

If instead you have to search a pattern in full text search, use this

your_search [ | inputlookup my_patterns.csv | rename field AS query | table query ]
| ...

I have a lookup with all the patterns to search typed by sourcetype, so I can use all patterns or only the ones with a specific sourcetype

your_search [ | inputlookup my_patterns.csv | search sourcetype=my_sourcetype | rename field AS query | table query ]
| ...

Bye.
Giuseppe

View solution in original post

0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi alfiyashaikh,
use a lookup to manage all your patterns to search:
if you have to search a value in a field, use this

your_search [ | inputlookup my_patterns.csv | table field ]
| ...

field name must be the same in search.

If instead you have to search a pattern in full text search, use this

your_search [ | inputlookup my_patterns.csv | rename field AS query | table query ]
| ...

I have a lookup with all the patterns to search typed by sourcetype, so I can use all patterns or only the ones with a specific sourcetype

your_search [ | inputlookup my_patterns.csv | search sourcetype=my_sourcetype | rename field AS query | table query ]
| ...

Bye.
Giuseppe

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.
Get Updates on the Splunk Community!

Thanks for the Memories! Splunk University, .conf25, and our Community

Thank you to everyone in the Splunk Community who joined us for .conf25, which kicked off with our iconic ...

Data Persistence in the OpenTelemetry Collector

This blog post is part of an ongoing series on OpenTelemetry. What happens if the OpenTelemetry collector ...

Introducing Splunk 10.0: Smarter, Faster, and More Powerful Than Ever

Now On Demand Whether you're managing complex deployments or looking to future-proof your data ...