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!

Infographic provides the TL;DR for the 2024 Splunk Career Impact Report

We’ve been buzzing with excitement about the recent validation of Splunk Education! The 2024 Splunk Career ...

Enterprise Security Content Update (ESCU) | New Releases

In December, the Splunk Threat Research Team had 1 release of new security content via the Enterprise Security ...

Why am I not seeing the finding in Splunk Enterprise Security Analyst Queue?

(This is the first of a series of 2 blogs). Splunk Enterprise Security is a fantastic tool that offers robust ...