Splunk Search

Charting the 2 fields on the same chart.

justinfranks
Path Finder

I have a log of login timestamps. I would like to display the total count and total unique value count on the same bar chart.

Here is my search:

sourcetype="etv" cname="*" ur="*" | stats dc(u) as "unique", count by u | chart sum(count) as "Total Logins", sum(unique) as "Total Unique Logins"

Where 'u' is the UserID.

However, this search charts the "Total Logins" by "Total Unique Logins", which is not what I want.

alt text

Is there a way chart this information, split by their field names?

Tags (2)
0 Karma
1 Solution

lguinn2
Legend

Would this work

sourcetype="etv" cname="*" ur="*" 
| stats dc(u) as "Total Unique Logins" count as "Total Logins"
| transpose

And then choose the Visualization tab

(After some thought, I figured out that you can simplify your calculations.)

View solution in original post

lguinn2
Legend

Would this work

sourcetype="etv" cname="*" ur="*" 
| stats dc(u) as "Total Unique Logins" count as "Total Logins"
| transpose

And then choose the Visualization tab

(After some thought, I figured out that you can simplify your calculations.)

justinfranks
Path Finder

Thanks! The transpose command was what I was missing.

0 Karma

lguinn2
Legend
sourcetype="etv" cname="*" ur="*" 
| stats dc(u) as "unique", count by u 
| stats sum(count) as "Total Logins", sum(unique) as "Total Unique Logins"

should work

justinfranks
Path Finder

I thought so too but here is what I get:

http://i.imgur.com/UR0dLKB.png

However, I'd like to have them on different bars of the count on the bottom.

0 Karma

rsennett_splunk
Splunk Employee
Splunk Employee

Incidentally... Depending on the difference between total logins and unique logins, you may need to set the y-axis to "log" rather than "linear" in order to see the relationship between them.

With Splunk... the answer is always "YES!". It just might require more regex than you're prepared for!
0 Karma
Get Updates on the Splunk Community!

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 ...

Index This | What are the 12 Days of Splunk-mas?

December 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...