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!

Automatic Discovery Part 1: What is Automatic Discovery in Splunk Observability Cloud ...

If you’ve ever deployed a new database cluster, spun up a caching layer, or added a load balancer, you know it ...

Real-Time Fraud Detection: How Splunk Dashboards Protect Financial Institutions

Financial fraud isn't slowing down. If anything, it's getting more sophisticated. Account takeovers, credit ...

Splunk + ThousandEyes: Correlate frontend, app, and network data to troubleshoot ...

 Are you tired of troubleshooting delays caused by siloed frontend, application, and network data? We've got a ...