I have a saved table dataset in Splunk. When I choose to "Investigate in Search" this table dataset, I see
sample 1
| from datamodel:"My_Table_ForDay"
The SPL My_Table_ForDay
looks like the following:
sample 2
index="my_index"
sourcetype="*"
earliest=@d
latest=now
| fields
_time
statusCode
result
| table
_time
statusCode
result
I would like to reuse My_Table_ForDay
for separate days. In other words, I would like to pass a value to the datamodel that's used in the query. I want to use a parameter for the earliest
attribute. For example, I would pass the following parameter values:
- For today:
@d
- For yesterday:
-1d@d
- Two days ago:
-2d@d
How do I a) pass a value from sample 1 and b) use a parameter in sample 2?
Thank you.