Splunk Search

Lookup Definition using Match Type

jackreeves
Explorer

I am attempting to create a new "Week" field based on an external lookup.

However, the date field in my sourcetype and lookup DO NOT match. The date field in the sourcetype is in following format %d/%m/%Y %H:%M (e.g. 31/05/2018 00:05). The Date field in my lookup table is in following format %d/%m%/Y (e.g. 31/05/2018).

Can I use Match Type in lookup definition to use a wildcard on Date field in order to return "Week" field? Can't seem to get it to work.

Thanks,
Jack

0 Karma

woodcock
Esteemed Legend

That feature does not work anything like what you need. Skip the lookup and just use something like this:

|makeresults | eval date="31/05/2018 00:05"
| eval _time = strptime(date, "%d/%m/%Y %H:%M")
| eval week=strftime(_time, "%Y-W%0W-%0w")
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 ...