Splunk Search

I have one server with 24 jvms.I need to write query for jvm down .I tried using inputlookup?

karthi2809
Builder

I have one server with 24 jvms.I need to write query for jvm down .I tried using inputlookup?

|inputlookup sample.csv |eval count=0| table JVMName count | append [search index=was source="/xx.log" NOT F5App |rex field=source "/ws/(?.)/http/access.log"| stats count by JVMName ]| stats sum(count) by JVMName | where count = 0

But i am not getting any alert?

Tags (3)
0 Karma

kamlesh_vaghela
SplunkTrust
SplunkTrust

Hi Karthi2809,

As I understand your issue, what you want is the count of only those JVMName which are defined in the lookup file.

As per given eg. if lookup file contains "JVMName" comma separated, then your CSV should be like this:

sample.csv
------------------------
JVMName
"node1,node2,node24"

lookup file should NOT like

sample.csv
------------------------
JVMName
node1,node2,node24 // It will consider only the first value "node1"

With this lookup file the search like this :

search index=was source="/xx.log" [|inputlookup sample.csv | eval JVMName=split(JVMName,",") | mvexpand JVMName | return 24 JVMName] NOT F5App | rex field=source "/ws/(?.)/http/access.log"| stats count by JVMName

==========================================================================================

In the case of lookup file, I suggest that keep JVMName one by one in a row, like:

sample.csv
------------------------
JVMName
node1
node2
node24

With this lookup file the search like this :

search index=was source="/xx.log" [|inputlookup sample.csv |  return 24 JVMName ] NOT F5App | rex field=source "/ws/(?.)/http/access.log"| stats count by JVMName

Here, I have used return command to pass value up from subsearch.

I hope this will help you.

Thanks
Kamlesh

0 Karma

kamlesh_vaghela
SplunkTrust
SplunkTrust

Hi Karthi2809,

Are you getting expected result from below search?

index=was source="/xx.log" NOT F5App | rex field=source "/ws/(?.)/http/access.log"

| stats count by JVMName

AND

Can you please provide information regarding sample.csv?

Thanks
Kamlesh

0 Karma

karthi2809
Builder

in sample.csv i added jvm names

eg: node1,node2......,node24

0 Karma

koshyk
Super Champion

what is sample.csv? can u please paste some raw data from index=was source="xx.log" ?

0 Karma
Get Updates on the Splunk Community!

Splunk Observability for AI

Don’t miss out on an exciting Tech Talk on Splunk Observability for AI!Discover how Splunk’s agentic AI ...

Splunk Enterprise Security 8.x: The Essential Upgrade for Threat Detection, ...

Watch On Demand the Tech Talk on November 6 at 11AM PT, and empower your SOC to reach new heights! Duration: ...

Splunk Observability as Code: From Zero to Dashboard

For the details on what Self-Service Observability and Observability as Code is, we have some awesome content ...