Splunk Search

Table count/dedup

axinjakson
Explorer

Have a basic report being built and I am having troubles with counts/dedup so to say. Below is my current output. What I would like are 1 of the 2 outputs further below, either with a count and the other fields can be overwritten with whatever the last found value was, or extra special if I could concat the values like at the very bottom. Any ideas?

source="Firewall" | table source dest blah1 blah2

source dest blah1 blah2

10.1.1.1 1.2.3.4 A B

10.1.1.1 1.2.3.4 B B

10.1.1.2 1.2.3.4 A B

Attempted searches

source="Firewall" | stats count by source dest blah1 blah2 count

source="Firewall" | stats count by source | table source dest blah1 blah2 count

source="Firewall" | stats count by source | join ?????? various types tried

Output needed

source dest blah1 blah2 count

10.1.1.1 1.2.3.4 A B 2

10.1.1.2 1.2.3.4 A B 1

Or preferred

source dest blah1 blah2 count

10.1.1.1 1.2.3.4 A,B B,B 2

10.1.1.2 1.2.3.4 A B 1

Tags (4)
0 Karma
1 Solution

gkanapathy
Splunk Employee
Splunk Employee

http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/CommonStatsFunctions so

... | stats latest(blah1) as blah1, latest(blah2) as blah2, count by src,dest

or

... | stats values(blah1) as blah1, values(blah2) as blah2, count by src,dest

or

... | stats list(blah1) as blah1, list(blah2) as blah2, count by src,dest

View solution in original post

gkanapathy
Splunk Employee
Splunk Employee

http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/CommonStatsFunctions so

... | stats latest(blah1) as blah1, latest(blah2) as blah2, count by src,dest

or

... | stats values(blah1) as blah1, values(blah2) as blah2, count by src,dest

or

... | stats list(blah1) as blah1, list(blah2) as blah2, count by src,dest
Get Updates on the Splunk Community!

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...