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!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...