Splunk Search

How to chart eventless days without losing drilldown after a _time field format?

alemarzu
Motivator

Hi there fellas,

I'm having troubles trying to chart eventless days when they are the first events to plot in a chronological order. What I'm trying to say is, if I want to chart from day 1 to 15, and let's say 1-2-3 are empty my chart starts from day 4.

My first attempt was "kinda okey", but since I've formatted _time field I couldn't drilldown anymore.

my_search | timechart count span=1d | rename _time AS Time, count as Quantity | eval Time=strftime(Time, "%d-%m")

In my second attempt, I was able to drilldown but couldn't chart first eventless days.

my_search | eval Time = _time | chart count as Quantity by Time span=1d | eval Time=strftime(Time, "%d-%m")

Sidenote: fillnull & makecontinuous didn't work. I've also tried to append fake data but I couldn't make it happen

What am I doing wrong ? Any help would be greatly appreciated.

EDIT: Recently I've created a dashboard and tried to drilldown to another form to avoid this but I'm facing the same issue. Formatted _time field = 0 events when drilldown.

0 Karma
1 Solution

alemarzu
Motivator

I've made it.

I did not replace my old timechart query, what I did was a simple drilldown redirection. Something like this.

 <drilldown target="_blank">
   <link>
     <![CDATA[search?q="my_main_search"&earliest=$token.earliest$&latest=$token.latest$]>
   </link>
 </drilldown>

View solution in original post

0 Karma

alemarzu
Motivator

I've made it.

I did not replace my old timechart query, what I did was a simple drilldown redirection. Something like this.

 <drilldown target="_blank">
   <link>
     <![CDATA[search?q="my_main_search"&earliest=$token.earliest$&latest=$token.latest$]>
   </link>
 </drilldown>
0 Karma

alemarzu
Motivator

Perhaps there's another way to accomplish what I'm looking for ? Is it possible ?

Wanted outcome; Plot count(y-axis) of events over days(x-axis), eventless days also. And format time to "%d-%m" without losing drilldown in the process.

In my previous attempts after formatting _time, drilldown returns 0 results.

0 Karma

Ayn
Legend

Any specific reason why you're not using timechart? It seems you're doing exactly what timechart would do but are missing the extra thing that timechart also does, which is include periods with no events. Using timechart, your search could be rewritten to simply this:

my_search | timechart span=1d count as Quantity

Jeff_Lightly_Sp
Communicator

I don't have data to test this right now but would usenull=f work?

chart count as Quantity by Time usenull=f span=1d

0 Karma

alemarzu
Motivator

Nope Jeff, it won't work.

Main problem actually is to format _time the way I want without losing drilldown because right now returns 0 results, and If i don't, it works.

0 Karma

alemarzu
Motivator

Ayn,

I understand what you are suggesting, but I'm not using timechart because I was trying to show %d-%m" for each day under the x-axis, and when I format _time field to do that, drilldown doesn't work anymore. Besides that there's no other reason.

Any other idea/solution ?

0 Karma
Get Updates on the Splunk Community!

CX Day is Coming!

Customer Experience (CX) Day is on October 7th!! We're so excited to bring back another day full of wonderful ...

Strengthen Your Future: A Look Back at Splunk 10 Innovations and .conf25 Highlights!

The Big One: Splunk 10 is Here!  The moment many of you have been waiting for has arrived! We are thrilled to ...

Now Offering the AI Assistant Usage Dashboard in Cloud Monitoring Console

Today, we’re excited to announce the release of a brand new AI assistant usage dashboard in Cloud Monitoring ...