Splunk Search

Help with below query

chandankr
Path Finder

100 * sum([x]) / sum([y] - [z])

 

Labels (1)
Tags (1)
0 Karma

yuanliu
SplunkTrust
SplunkTrust

Pro tip: When asking a question in a forum about data analytics, first explain your data, with anonymized sample if possible, explain what you are trying to achieve and, if you illustrate sample code, also illustrate the output and explain why the output doesn't meet your requirements.  "Help with" is not a question without other qualifiers.

0 Karma

chandankr
Path Finder

trying to fetch some values and apply this athematic to get some relevant info for dashboard.

100 * sum([M8020C3]) / sum([M8020C6] - [M8020C4])

using the below splunk query 

index=* "M8020C3" AND "M8020C6" AND "M8020C4"
| rex field=_raw "<measResults>\d+\s\d+\s\d+\s+(?<cell_avl3>\d+)\s(?<cell_avl4>\d)\s\d+\s+(?<cell_avl6>\d+)"
| stats sum(cell_avl3) as cell_avl3 sum(cell_avl6) as cell_avl6 sum(cell_avl4) as cell_acl4
| eval cell_avl5 = cell_avl6-cell_avl4
| eval cell_avl10=cell_avl3/cell_avl5
| eval cell_avl=100*cell_avl10
| stats count by date_month,cell_avl

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Agent Mode Engaged! Enchaining Agentic Operations with Splunk AI Assistant 2.0

    Are you ready to transform how your team handles complex data requests? We invite you to our upcoming ...

Announcing Modern Navigation: A New Era of Splunk User Experience

We are excited to introduce the Modern Navigation feature in the Splunk Platform, available to both cloud and ...

Modernize your Splunk Apps – Introducing Python 3.13 in Splunk

We are excited to announce that the upcoming releases of Splunk Enterprise 10.2.x and Splunk Cloud Platform ...