Splunk Search

Can you help me with a query with the timechart command?

mlorrette
Path Finder

same search: timespan showing X results while search is showing Y results for the same timeframe.

This search that is part of a dashboard shows events on a Last 30 Days timeframe:

index=application "login.categories{}"="User Failed Login" | dedup user | timechart count span=1d

It returns 80 events for a particular date.
When I open the visualization in the search, I still see a count of 80 events for that one date.

However, when I zoom in on that day, through View Events or Narrow to This Timeframe, 130 events come up. Expanding the |timechart search for the last 3 months, now shows 50 events on that one specific date! The only thing I'm changing is the timeframe.

What's going on with timechart? Using Splunk 6.5.2.

0 Karma
1 Solution

briancronrath
Contributor

It's because you are deduping. It is expected that if you zoom out further, you'll get less users on that time frame because it will have most likely had duplicates in other timeframes (and they will get tallied only once over the entire timeframe). Similarly if you zoom in you'll get more results in the time frame because the deduping is more focused to a shorter timeframe.

Are you looking to dedup based on specific buckets of time? For instance, are you wanting to dedup in regards to just each day worth of logins? If so, dedup won't be the command you want, you'd be better off doing a

[...] | timechart dc(user) span=1d

View solution in original post

briancronrath
Contributor

It's because you are deduping. It is expected that if you zoom out further, you'll get less users on that time frame because it will have most likely had duplicates in other timeframes (and they will get tallied only once over the entire timeframe). Similarly if you zoom in you'll get more results in the time frame because the deduping is more focused to a shorter timeframe.

Are you looking to dedup based on specific buckets of time? For instance, are you wanting to dedup in regards to just each day worth of logins? If so, dedup won't be the command you want, you'd be better off doing a

[...] | timechart dc(user) span=1d

woodcock
Esteemed Legend

I was getting ready to type the same thing!

0 Karma

mlorrette
Path Finder

This is working perfectly. In a hindsight, it's "obvious" because the | dedup part comes before the timechart piece. Very heplful. Thank you.

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

[Puzzles] Solve, Learn, Repeat: Matching cron expressions

This puzzle (first published here) is based on matching timestamps to cron expressions.All the timestamps ...

Design, Compete, Win: Submit Your Best Splunk Dashboards for a .conf26 Pass

Hello Splunkers,  We’re excited to kick off a Splunk Dashboard contest! We know that dashboards are a primary ...

May 2026 Splunk Expert Sessions: Security & Observability

Level Up Your Operations: May 2026 Splunk Expert Sessions Whether you are refining your security posture or ...