Splunk Search

charting time - using time within a lookup

brdr
Contributor

I have a lookup file with about 100K events. What I want to do is use timechart (span each day). There is a time field in the lookup called '_time'. I have:

| inputlookup mylookup.csv
| timechart span=1d sum(count)

Can I do this?

Tags (1)
0 Karma
1 Solution

somesoni2
Revered Legend

So what you want your query to do, show count of entries in the lookup per day or sum of some field's value? If you just want to see how many entries falls into a day, just use function count (no need to specify a field if just counting events).

 | inputlookup mylookup.csv 
 | convert timeformat="%Y-%m-%dT%H:%M:%S" mktime(_time) as _time
 | timechart span=1d count as Daily_Total

View solution in original post

0 Karma

somesoni2
Revered Legend

So what you want your query to do, show count of entries in the lookup per day or sum of some field's value? If you just want to see how many entries falls into a day, just use function count (no need to specify a field if just counting events).

 | inputlookup mylookup.csv 
 | convert timeformat="%Y-%m-%dT%H:%M:%S" mktime(_time) as _time
 | timechart span=1d count as Daily_Total
0 Karma

brdr
Contributor

ah man... thank you somesoni2!

0 Karma

niketn
Legend

@brdr if your issue is resolved, do accept the answer to mark this question as answered.

____________________________________________
| makeresults | eval message= "Happy Splunking!!!"
0 Karma

somesoni2
Revered Legend

You can use timechart command as long as _time field in your lookup has date in epoch format. You can use sum(count) if there is a field count exists in the lookup.

0 Karma

brdr
Contributor

This is what I have. I do have a field called 'count' in my lookup that I don't care about. Here is my search:

| inputlookup mylookup.csv 
| convert timeformat="%Y-%m-%dT%H:%M:%S" mktime(_time) as _time
| rename count as count_c
| timechart span=1d sum(count) as Daily_Total

I see that _time is display the days, but Daily_Total is NULL (blank)??

0 Karma
Get Updates on the Splunk Community!

Splunk Search APIを使えば調査過程が残せます

   このゲストブログは、JCOM株式会社の情報セキュリティ本部・専任部長である渡辺慎太郎氏によって執筆されました。 Note: This article is published in both Japanese ...

Integrating Splunk Search API and Quarto to Create Reproducible Investigation ...

 Splunk is More Than Just the Web Console For Digital Forensics and Incident Response (DFIR) practitioners, ...

Congratulations to the 2025-2026 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...