Splunk Search

Best way to use multipe searchs to get shared result that can be used for percentage.

cbright
Explorer

Trying to use multiple searches to get a percentage of total servers to be restored and total currently restored but can not get all values to be shared.

I know it is the construct or the searches but can not figure out the issue, need some help to get the format right.

Here is the search that uses indexed data and lookup files:

|inputlookup DRServerList.csv
|search PhysicalVirtual=P (Platform!=IP* AND Platform!=link*)
|stats count as allPhys
|append [search index=main sourcetype=ssdr Result=good
| rex field=_raw "^(?:[^ \n]* ){6}(?\w+):\s+(?P.)(?:[^ \n] ){2}(?P\w+)\s+::\s+(?P\w+)(?:[^ \n]* ).::\s(?P.+)"
|dedup Node

| eval HostName=lower(Node)
| join [inputlookup DRServerList.csv
|search PhysicalVirtual=P (Platform!=IP
AND Platform!=link*)
|eval HostName=lower(HostName)]
| stats count(eval(HostName==lower(HostName))) AS restore]
| eval mypercent=(restore/allPhys*100)
|table allPhys restore mypercent

Tags (1)

jdonn_splunk
Splunk Employee
Splunk Employee

Glad to see you fixed it on your own. I just wanted to comment so that it did not appear not to be resolved / answered.

0 Karma

cbright
Explorer

Figured it out needed a another join where I had the append in the search.

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

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Community Content Calendar, September edition

Welcome to another insightful post from our Community Content Calendar! We're thrilled to continue bringing ...

Splunkbase Unveils New App Listing Management Public Preview

Splunkbase Unveils New App Listing Management Public PreviewWe're thrilled to announce the public preview of ...

Leveraging Automated Threat Analysis Across the Splunk Ecosystem

Are you leveraging automation to its fullest potential in your threat detection strategy?Our upcoming Security ...