Reporting

How to schedule a daily search that appends new results as a separate column per day and export as an Excel sheet?

anuradhaschauha
New Member

Hi,

I have the following query:

index=src | stats count by message

which gives me results as

message    count 
a1         10
a2         40

I want to run this query everyday and the results should be appended as a separate column per day as

message    count     count2
a1         10        23
a2         40        45

and I want the results to be in an excel sheet daily. Is it possible to do so in Splunk ?

thanks
pks

0 Karma

HiroshiSatoh
Champion

How to process a pivot table of EXCEL data that was exported You?

(search)
index=src| eval Date=strftime(_time, "%Y-%m-%d")|stats count by Date,message
(Result)
Date message count
2014-10-1 a1 10
2014-10-1 a2 40
2014-10-2 a1 23

2014-10-2 a2 45

(export csv)
Date message count
2014-10-1, a1, 10
2014-10-1, a2, 40
2014-10-2, a1, 23

2014-10-2, a2, 45

(EXECL PIVOT TABLE)
Line : message
Column : Date

Value : count

message |2014-10-1 |2014-10-2
a1 |10 | 23
a2 |40 |45

0 Karma

aljohnson_splun
Splunk Employee
Splunk Employee

You might benefit the app for Excel Export

https://apps.splunk.com/app/760/#/documentation

You might also benefit from using the outputcsv command

http://docs.splunk.com/Documentation/Splunk/6.1.4/SearchReference/Outputcsv

0 Karma
Get Updates on the Splunk Community!

A Season of Skills: New Splunk Courses to Light Up Your Learning Journey

There’s something special about this time of year—maybe it’s the glow of the holidays, maybe it’s the ...

Announcing the Migration of the Splunk Add-on for Microsoft Azure Inputs to ...

Announcing the Migration of the Splunk Add-on for Microsoft Azure Inputs to Officially Supported Splunk ...

Splunk Observability for AI

Don’t miss out on an exciting Tech Talk on Splunk Observability for AI! Discover how Splunk’s agentic AI ...