Splunk Search

Chart count with timespan

timyong80
Explorer

I have a query that produce a sample of the results below.

DateTimeNamespaceType
18-May-20sys-uatCompliance
5-May-20emit-ssg-ossCompliance
5-May-20sast-prdVulnerability
5-Jun-20portal-apiCompliance
8-Jun-20ssc-accCompliance

I would like to count the number Type each Namespace has over a period of time. The end result visualization chart should look like this.

chart.jpg

This would display the count of each Namespace (grouped by day or month) based on the time picker. For eample, sys-uat has a total 20 count Types for May and 9 count Types for June. This way, I can compare the counts each Namespace has side by side.

If I do this,

| timechart span=1month count by Namespace

 the Namespace is split between the months.

chart2.jpg

I want each Namespace to be displayed side by side. For example, the blue bars should be side by side instead of being split. Is there a way to do this?

Thank you.

Labels (3)
0 Karma

to4kawa
Ultra Champion

sample:

| tstats count where index=_internal sourcetype=splunkd* by _time span=1month sourcetype
| xyseries _time sourcetype count

 viz >> Column Chart

why don't you try xyseries ?

recommend:

index=yours .....
| bin _time span=1month
| stats count by _time Namespace
| eval DateTime=strftime(_time,"%b-%y")
| xyseries DateTime Namespace count
0 Karma

skrajkumar_splu
Splunk Employee
Splunk Employee

Try using Bin span to group all dates to corresponding months  and chart command instead of time chart like in below snippet

skrajkumar_splu_1-1591861322546.png

 

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Persistent Queue at TcpOut — One of Splunk's Most Practical Features

Splunk introduced persistent queueing at the tcpout layer as one of the most practical resilience features in ...

Skip the Awkward Silence: Have a .conf-ersation at .conf26

Picture this. You arrive at .conf26 already having your socializing and networking plans mapped out. No ...

Rethinking Zero Trust: From Product Purchases to Logical Control Evidence

Implementing Zero Trust (ZT) across complex environments often falters at the very beginning due to a ...