Knowledge Management

How to pass variable to collect argument "file"?

morethanyell
Builder

Hi,

How can I pass the epoch time now() to the file argument of collect?

| ...
| collect spool=t addtime=t index="ourindex" file="[here, the current time here please thanks]_event.stash_new"
0 Karma
1 Solution

morethanyell
Builder

this

| ...
| collect spool=t addtime=t index="ourindex" 
    [ | makeresults
    | eval retval = "file=" . strftime(now(), "%s") . "_event.stash_new"
    | return $retval ]

View solution in original post

0 Karma

morethanyell
Builder

this

| ...
| collect spool=t addtime=t index="ourindex" 
    [ | makeresults
    | eval retval = "file=" . strftime(now(), "%s") . "_event.stash_new"
    | return $retval ]
0 Karma
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 ...