Splunk Search

How to create a stats/table with day by day search?

tpaulsen
Contributor

We are running every night a scheduled search:

sourcetype="statistik" (FZ!=0 AND AZ!=0) | stats sum(FZ) sum(AZ) by FNR,FKZ | sort FNR

The output looks like this:

FNR        FKZ          sum(FZ)          sum(AZ)
358        4            23523            233
359        00           2                42525

The data is collected out of a file that is also created once a day and has only one timestamp per day.

We would like to create now a weekly report, that includes as colons all 7 days. Like this:

FNR        FKZ          sum(FZ)d1        sum(AZ)d1          sum(FZ)d2         sum(AZ)d2
358        4            23523            233                3454              5
359        00           2                42525              34                1233

How can we achieve this?

Tags (1)
0 Karma

dineshraj9
Builder

This will give you daywise statistics -

sourcetype="statistik" (FZ!=0 AND AZ!=0) | bin span=1d _time | eval DAY=strftime(_time,"%Y-%m-%d") | stats sum(FZ) sum(AZ) by DAY

0 Karma

woodcock
Esteemed Legend

Try this:

sourcetype="statistik" (FZ!=0 AND AZ!=0) | timechart span=1d sum(FZ) sum(AZ) by FNR,FKZ
Get Updates on the Splunk Community!

Welcome to the Splunk Community!

(view in My Videos) We're so glad you're here! The Splunk Community is place to connect, learn, give back, and ...

Tech Talk | Elevating Digital Service Excellence: The Synergy of Splunk RUM & APM

Elevating Digital Service Excellence: The Synergy of Real User Monitoring and Application Performance ...

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...