Splunk Search

How to assign current week # to events?

atebysandwich
Path Finder

I have a list of events that happened over the last couple of weeks but the will be appended as it will be ran each week. I would like to create a search to show the number week of the year corresponding with the event. 

I was was thinking something like this, but it applies to all events regardless of the time stamp. 

 

| eval Current_Week=tonumber(strftime(now(),"%V"))

 

I understand I need to add more to the eval command to compare time of the event. 

Labels (1)
0 Karma

yuanliu
SplunkTrust
SplunkTrust

Do you mean this?  Not clear what was the desired result.

| eval Then_Week=tonumber(strftime(_time,"%V"))

 

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!

Announcing Modern Navigation: A New Era of Splunk User Experience

We are excited to introduce the Modern Navigation feature in the Splunk Platform, available to both cloud and ...

Modernize your Splunk Apps – Introducing Python 3.13 in Splunk

We are excited to announce that the upcoming releases of Splunk Enterprise 10.2.x and Splunk Cloud Platform ...

Step into “Hunt the Insider: An Splunk ES Premier Mystery” to catch a cybercriminal ...

After a whole week of being on call, you fell asleep on your keyboard, and you hit a sequence of buttons that ...