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
Get Updates on the Splunk Community!

Index This | I’m short for "configuration file.” What am I?

May 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with a Special ...

New Articles from Academic Learning Partners, Help Expand Lantern’s Use Case Library, ...

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

Your Guide to SPL2 at .conf24!

So, you’re headed to .conf24? You’re in for a good time. Las Vegas weather is just *chef’s kiss* beautiful in ...