Splunk Search

How to edit my search to create an overlay on a time chart with two CSV files using the date as the common field?

dbcase
Motivator

Hi,

I have two CSV files

File 1=bbOrCellOffline . index=betadb

Contents look like this

1004876,1004574,TCA301,Y,N,01-26-2017 12:01:10,null

File 2 Beta.csv . index=version

Contents look like this

01-26-2017 16:04:10,7_3_10_000500_3851899

What I'm looking to do is have a time chart that counts all events in the bbOrCellOffline file (easy enough), but then overlay the events from the Beta.csv file. (getting stuck here)

My (non working) query looks like this

(index=betadb OR index=allmsos) (source=*bbOrCellOffline* OR source=*Beta.csv*) |timechart count as Count count(eval(source="*Beta.csv*")) as "Version Count"

Any thoughts?

0 Karma
1 Solution

lguinn2
Legend

Try this:

(index=betadb OR index=allmsos) (source=*bbOrCellOffline* OR source=*Beta.csv*) 
| eval theSource=if(index=="betadb","bbOrCellOffline","Beta.csv")
| timechart count by theSource
| addtotals

If you don't want the Total column, you can simply leave off the addtotals command. Once you have the chart that you want, use the formatting commands to decide which line will be the overlay...

View solution in original post

0 Karma

lguinn2
Legend

Try this:

(index=betadb OR index=allmsos) (source=*bbOrCellOffline* OR source=*Beta.csv*) 
| eval theSource=if(index=="betadb","bbOrCellOffline","Beta.csv")
| timechart count by theSource
| addtotals

If you don't want the Total column, you can simply leave off the addtotals command. Once you have the chart that you want, use the formatting commands to decide which line will be the overlay...

0 Karma
Get Updates on the Splunk Community!

Updated Team Landing Page in Splunk Observability

We’re making some changes to the team landing page in Splunk Observability, based on your feedback. The ...

New! Splunk Observability Search Enhancements for Splunk APM Services/Traces and ...

Regardless of where you are in Splunk Observability, you can search for relevant APM targets including service ...

Webinar Recap | Revolutionizing IT Operations: The Transformative Power of AI and ML ...

The Transformative Power of AI and ML in Enhancing Observability   In the realm of IT operations, the ...