<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Temporal Lookups in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Temporal-Lookups/m-p/51307#M12386</link>
    <description>&lt;P&gt;Hi, I was hoping to use a lookup table to add some fields but it doesn't seem to do quite what I was hoping.&lt;/P&gt;

&lt;P&gt;I have the following file, lookup.csv:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;timestamp,host,env
2010-02-28 17:26:00,host1,dev
2010-02-28 16:50:00,host2,uat
2010-02-28 16:34:00,host1,uat
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;and I would like events from host1 to have the field env=uat for events up until 17:26 and env=dev for events after that.  Instead all events have the field env=dev.&lt;/P&gt;

&lt;P&gt;My transforms.conf looks like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[mylookup]
filename = lookup.csv
time_field = timestamp
time_format = %Y-%m-%d %H:%M:%S
default_match = unknown
case_sensitive_match = false
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Is this expected?  Is there another way to achieve what I'm looking for?&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
    <pubDate>Tue, 01 Mar 2011 02:07:45 GMT</pubDate>
    <dc:creator>craigmunro</dc:creator>
    <dc:date>2011-03-01T02:07:45Z</dc:date>
    <item>
      <title>Temporal Lookups</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Temporal-Lookups/m-p/51307#M12386</link>
      <description>&lt;P&gt;Hi, I was hoping to use a lookup table to add some fields but it doesn't seem to do quite what I was hoping.&lt;/P&gt;

&lt;P&gt;I have the following file, lookup.csv:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;timestamp,host,env
2010-02-28 17:26:00,host1,dev
2010-02-28 16:50:00,host2,uat
2010-02-28 16:34:00,host1,uat
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;and I would like events from host1 to have the field env=uat for events up until 17:26 and env=dev for events after that.  Instead all events have the field env=dev.&lt;/P&gt;

&lt;P&gt;My transforms.conf looks like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[mylookup]
filename = lookup.csv
time_field = timestamp
time_format = %Y-%m-%d %H:%M:%S
default_match = unknown
case_sensitive_match = false
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Is this expected?  Is there another way to achieve what I'm looking for?&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 01 Mar 2011 02:07:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Temporal-Lookups/m-p/51307#M12386</guid>
      <dc:creator>craigmunro</dc:creator>
      <dc:date>2011-03-01T02:07:45Z</dc:date>
    </item>
    <item>
      <title>Re: Temporal Lookups</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Temporal-Lookups/m-p/51308#M12387</link>
      <description>&lt;P&gt;The stanza above should be in transforms.conf, since it defines the lookup table. To make it apply for a given sourcetype, you should add to props.conf:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[&amp;lt;sourcetype&amp;gt;]
LOOKUP-env = mylookup host OUTPUT env
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Editing to include new findings:&lt;/P&gt;

&lt;OL&gt;
&lt;LI&gt;I can't reproduce the problem using time_format and rendered time, provided I change it to 2011, not 2010 (I haven't tried with 2010).&lt;/LI&gt;
&lt;LI&gt;It works if I use UTC epoch time, like &lt;CODE&gt;1298942760,host1,dev&lt;/CODE&gt; and take out the time_format attribute in transforms.conf.&lt;/LI&gt;
&lt;/OL&gt;

&lt;P&gt;Are you sure that you're looking at data from 2010 and not 2011?&lt;/P&gt;</description>
      <pubDate>Tue, 01 Mar 2011 02:37:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Temporal-Lookups/m-p/51308#M12387</guid>
      <dc:creator>Stephen_Sorkin</dc:creator>
      <dc:date>2011-03-01T02:37:19Z</dc:date>
    </item>
    <item>
      <title>Re: Temporal Lookups</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Temporal-Lookups/m-p/51309#M12388</link>
      <description>&lt;P&gt;Thanks Stephen, actually the stanza is in transforms.conf and I have the correct entry in props.conf  I've corrected my question.&lt;/P&gt;</description>
      <pubDate>Tue, 01 Mar 2011 17:22:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Temporal-Lookups/m-p/51309#M12388</guid>
      <dc:creator>craigmunro</dc:creator>
      <dc:date>2011-03-01T17:22:17Z</dc:date>
    </item>
    <item>
      <title>Re: Temporal Lookups</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Temporal-Lookups/m-p/51310#M12389</link>
      <description>&lt;P&gt;Yes, that did it.  Changing to the correct year (!) and using UTC time everything now works.&lt;/P&gt;

&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 02 Mar 2011 01:51:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Temporal-Lookups/m-p/51310#M12389</guid>
      <dc:creator>craigmunro</dc:creator>
      <dc:date>2011-03-02T01:51:10Z</dc:date>
    </item>
  </channel>
</rss>

