Splunk Search

change time on date field

_Mauro_Costa_
Explorer

Hello,
I have 2 columns, one with date and other with the day of week
based on day of week whenever is Saturday or Sunday, I want to change the time to 9 am
How can I do this?

submitteddayweekresult
13/03/2025 14:24Thursday13/03/2025 14:24
12/03/2025 09:31Wednesday12/03/2025 09:31
11/03/2025 13:45Tuesday11/03/2025 13:45
10/03/2025 18:11Monday10/03/2025 18:11
09/03/2025 11:21Sunday09/03/2025 09:00
08/03/2025 21:55Saturday08/03/2025 09:00
07/03/2025 10:24Friday07/03/2025 10:24
Labels (1)
0 Karma
1 Solution

gcusello
SplunkTrust
SplunkTrust

Hi @_Mauro_Costa_ ,

you could try with:

| eval date=if(dayweek IN (Saturday,Sunday),strftime(strptime(date,"%d/%m/%Y %H:%M"),"%d/%m/%Y 9.00"), date)

Ciao.

Giuseppe

View solution in original post

gcusello
SplunkTrust
SplunkTrust

Hi @_Mauro_Costa_ ,

you could try with:

| eval date=if(dayweek IN (Saturday,Sunday),strftime(strptime(date,"%d/%m/%Y %H:%M"),"%d/%m/%Y 9.00"), date)

Ciao.

Giuseppe

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!

How much can you really learn in 3 minutes?

Observability can certainly be hard to understand – there's a lot of jargon and buzzwords and it seems to ...

Event Series: The Agentic SOC: Trust Before Autonomy

AI is fundamentally changing security operations, but true progress requires more than just automation—it ...

Free Professional Services for .conf26 Attendees

This year at .conf26, we are doing something a little different. We are bringing the best minds from ...