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!

Updated Data Type Articles, Anniversary Celebrations, and More on Splunk Lantern

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

A Prelude to .conf25: Your Guide to Splunk University

Heading to Boston this September for .conf25? Get a jumpstart by arriving a few days early for Splunk ...

4 Ways the Splunk Community Helps You Prepare for .conf25

.conf25 is right around the corner, and whether you’re a first-time attendee or a seasoned Splunker, the ...