Splunk Search

Custom Splunk query

Ash1
Communicator
|mstats sum(faliure.count) as Failed where index=metric-logs by service application_codes

Form the above query i am getting the results of service and application_codes.

But my requirement is to get the application_codes from a csv file and  from only type=error1

below is the csv file

application_codesDescriptionType
0error descp 1error1
10error descp 2error2
10870error descp 3error3
1206error descp 1error1
11error descp 3error3
17error descp 2error2
18error descp 1error1
14error descp 2error2
1729error descp 1error1

 

 

Labels (1)
0 Karma

yuanliu
SplunkTrust
SplunkTrust

For this problem, using the lookup in subsearch is more direct and potentially more efficient.

|mstats sum(faliure.count) as Failed where index=metric-logs by service application_codes
| search type = error1
  [inputlookup app.csv]

 

Tags (1)
0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Try lookup of application_codes in csv and then filter by type

0 Karma

Ash1
Communicator
|mstats sum(faliure.count) as Failed where index=metric-logs by service application_codes
|lookup app.csv  application_codes

when i run the above query i am getting application_codes from mstats query not from csv file

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Please can you give an example of your expected results?

0 Karma

Ash1
Communicator
application_codes
0
1206
18
1729

 

i want to see only the above application codes, that is from csv file only.

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

If you just want the application codes, why are you doing the mstats?

| inputlookup app.csv
| where Type="error1"
| table application_codes
0 Karma
Get Updates on the Splunk Community!

Introducing the Splunk Community Dashboard Challenge!

Welcome to Splunk Community Dashboard Challenge! This is your chance to showcase your skills in creating ...

Built-in Service Level Objectives Management to Bridge the Gap Between Service & ...

Wednesday, May 29, 2024  |  11AM PST / 2PM ESTRegister now and join us to learn more about how you can ...

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer Certification at ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...