Splunk Search

Stats for group of devices

bigll
Path Finder

I want to create statistic per group of device rather than individual devices.
I tried eval, but it produced no result.

| eval GR=case (host=5087, GR2, host=7750, GR1, host=7751, GR1, host=7752, GR2)
| stats count by GR.



TIA, Leon

Labels (2)
Tags (2)
0 Karma

bigll
Path Finder

Gents.

Thank you very much.
Proper placement of camas and double quotes solved the issue

------------

0 Karma

richgalloway
SplunkTrust
SplunkTrust

If your problem is resolved, then please click the "Accept as Solution" button to help future readers.

---
If this reply helps you, Karma would be appreciated.
0 Karma

bigll
Path Finder

Thank you for recommendations. 
Gut an error:
Error in 'EvalCommand': The expression is malformed. Expected ).
Am I need double (()) around entire statement?

 

0 Karma

richgalloway
SplunkTrust
SplunkTrust

You do not need double parentheses.  Verify the parentheses and quotation marks match.  Share your exact query if you need an extra set of eyes to look at it.

---
If this reply helps you, Karma would be appreciated.

richgalloway
SplunkTrust
SplunkTrust

Have you tried putting quotes around the group names?

| eval GR=case(host=5087, "GR2", host=7750, "GR1", host=7751, "GR1", host=7752, "GR2")
| stats count by GR
---
If this reply helps you, Karma would be appreciated.

gcusello
SplunkTrust
SplunkTrust

Hi @bigll,

use quotes in eval:

| eval GR=case(host="5087", "GR2", host="7750", "GR1", host="7751", "GR1", host="7752", "GR2")
| stats count by GR.

Ciao.

Giuseppe

Get Updates on the Splunk Community!

Observability Unlocked: Kubernetes Monitoring with Splunk Observability Cloud

  Ready to master Kubernetes and cloud monitoring like the pros?Join Splunk’s Growth Engineering team for an ...

Wrapping Up Cybersecurity Awareness Month

October might be wrapping up, but for Splunk Education, cybersecurity awareness never goes out of season. ...

🌟 From Audit Chaos to Clarity: Welcoming Audit Trail v2

🗣 You Spoke, We Listened  Audit Trail v2 wasn’t written in isolation—it was shaped by your voices.  In ...