Splunk Search

How to add random month into event with only year

vgrand2
Explorer

Hi @links

I have event with future year 2021, 2022. I need to add random months into the years. Do you know which syntax can be used on this ?

Labels (1)
Tags (1)
0 Karma
1 Solution

richgalloway
SplunkTrust
SplunkTrust

Lacking more specifics about your use case, I offer this as an idea.

| eval month = (random()%12)+1
---
If this reply helps you, Karma would be appreciated.

View solution in original post

vgrand2
Explorer

Thanks @richgalloway . That is what I was looking for!

0 Karma

richgalloway
SplunkTrust
SplunkTrust

Lacking more specifics about your use case, I offer this as an idea.

| eval month = (random()%12)+1
---
If this reply helps you, Karma would be appreciated.
Get Updates on the Splunk Community!

Modern way of developing distributed application using OTel

Recently, I had the opportunity to work on a complex microservice using Spring boot and Quarkus to develop a ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had 3 releases of new security content via the Enterprise Security ...

Archived Metrics Now Available for APAC and EMEA realms

We’re excited to announce the launch of Archived Metrics in Splunk Infrastructure Monitoring for our customers ...