Hi, as stated above, lookup won't help. You could, however, try this one instead, using a join with inputlookup to get your values:
... deleted Plan A that isn't working in this case, as previously I used tokens instead of query fields... let's move to plan B...
This time it works, I've just tested it wit the following prices.csv:
product_id,effective_start,effective_end,price
foo,1560962373,1570962373,66
foo,1570962373,1590962373,69
bar,1550962373,1580962373,96
bar,1580962373,1590962373,99
And this is the query to solve your question:
|makeresults | eval product_id="foo" | eval time=now()
| join max=0 product_id [|inputlookup prices.csv]|where time>effective_start AND time<effective_end
Note:
1. The join is still necessary, because you want one event per match, not one event in total with multi-value fields for price and dates that you would get from a lookup
2. As always, the first line is just to recreate some meaningful data for the join. Exchange with your own query to get the product_id
3. Use your own lookup instead of my prices.csv and for being a lazy typist I omitted the _date in the time names
... View more