Splunk Search

How do I create a timechart by month, but starting with the 15th day of the month? (15th - 14th)

markgandolfo
Engager

Hi,

I'm trying to timechart by month, but starting at the 15th of the month. I've looked for "offsets", but I can't seem to find anything helpful.

Can someone point me in the correct direction?

Thanks
Mark

1 Solution

javiergn
SplunkTrust
SplunkTrust

This is what I've tried and seems to be working fine but I've only got two months worth of data so ...

index=_internal
| eval mytime = if(date_mday<=15, _time, _time+(15*24*60*60))
| bucket mytime span=1mon
| eval month = strftime(mytime, "%B")
| chart count over mytime by month
| eval mytime = "Mid-" . strftime(mytime, "%B")

View solution in original post

fdi01
Motivator

try like :

your_base_search ... date_mday>=15| timechart span=1months count

example:

index = _internal date_mday>=15| timechart span=1months count

0 Karma

javiergn
SplunkTrust
SplunkTrust

This is what I've tried and seems to be working fine but I've only got two months worth of data so ...

index=_internal
| eval mytime = if(date_mday<=15, _time, _time+(15*24*60*60))
| bucket mytime span=1mon
| eval month = strftime(mytime, "%B")
| chart count over mytime by month
| eval mytime = "Mid-" . strftime(mytime, "%B")

chimell
Motivator

Hi
try this example and tell if it help you

 index=_internal  |timechart count by date_month where (date_mday>=15 and date_mday=<31)
0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...