<?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 Add &amp;quot;Price&amp;quot; field with different values for specific timeranges in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Add-quot-Price-quot-field-with-different-values-for-specific/m-p/159435#M44991</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I'm adding a "Price" field to each product in the events. Therefore I'm using a lookup which includes the productname and the price.&lt;/P&gt;

&lt;P&gt;&lt;EM&gt;| lookup Pricelist.csv productname OUTPUT price&lt;/EM&gt;&lt;/P&gt;

&lt;P&gt;Is there a way to add different prices for specific timeranges? For Instance, Product A had a price of 5.00 until 24.11.2013, but for events &amp;gt;=25.11.2013 I would like to have a value of 3.00 in all events including product A.&lt;/P&gt;

&lt;P&gt;Perhaps using a second lookup in combination with something like "if _time&amp;gt;=X lookup Pricelist2.csv productname OUTPUT price"?&lt;/P&gt;

&lt;P&gt;Thanks in advance&lt;/P&gt;</description>
    <pubDate>Thu, 28 Nov 2013 09:02:44 GMT</pubDate>
    <dc:creator>HeinzWaescher</dc:creator>
    <dc:date>2013-11-28T09:02:44Z</dc:date>
    <item>
      <title>Add "Price" field with different values for specific timeranges</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Add-quot-Price-quot-field-with-different-values-for-specific/m-p/159435#M44991</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I'm adding a "Price" field to each product in the events. Therefore I'm using a lookup which includes the productname and the price.&lt;/P&gt;

&lt;P&gt;&lt;EM&gt;| lookup Pricelist.csv productname OUTPUT price&lt;/EM&gt;&lt;/P&gt;

&lt;P&gt;Is there a way to add different prices for specific timeranges? For Instance, Product A had a price of 5.00 until 24.11.2013, but for events &amp;gt;=25.11.2013 I would like to have a value of 3.00 in all events including product A.&lt;/P&gt;

&lt;P&gt;Perhaps using a second lookup in combination with something like "if _time&amp;gt;=X lookup Pricelist2.csv productname OUTPUT price"?&lt;/P&gt;

&lt;P&gt;Thanks in advance&lt;/P&gt;</description>
      <pubDate>Thu, 28 Nov 2013 09:02:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Add-quot-Price-quot-field-with-different-values-for-specific/m-p/159435#M44991</guid>
      <dc:creator>HeinzWaescher</dc:creator>
      <dc:date>2013-11-28T09:02:44Z</dc:date>
    </item>
    <item>
      <title>Re: Add "Price" field with different values for specific timeranges</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Add-quot-Price-quot-field-with-different-values-for-specific/m-p/159436#M44992</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;

&lt;P&gt;Probably it would be better to have only one lookup, and include the time, in epoch when the price changed. And then do a eval to see which price should be used&lt;/P&gt;

&lt;P&gt;Regards&lt;/P&gt;</description>
      <pubDate>Thu, 28 Nov 2013 09:48:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Add-quot-Price-quot-field-with-different-values-for-specific/m-p/159436#M44992</guid>
      <dc:creator>gfuente</dc:creator>
      <dc:date>2013-11-28T09:48:05Z</dc:date>
    </item>
    <item>
      <title>Re: Add "Price" field with different values for specific timeranges</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Add-quot-Price-quot-field-with-different-values-for-specific/m-p/159437#M44993</link>
      <description>&lt;P&gt;Do you mean a lookup like this?&lt;/P&gt;

&lt;P&gt;productname, price, epochtime&lt;BR /&gt;
ProductA, 5.00, 1385251200&lt;BR /&gt;
ProductA, 3.00, 1385337600&lt;/P&gt;

&lt;P&gt;How can I configure the lookup command what price to add to the field with an eval command?&lt;/P&gt;</description>
      <pubDate>Thu, 28 Nov 2013 09:52:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Add-quot-Price-quot-field-with-different-values-for-specific/m-p/159437#M44993</guid>
      <dc:creator>HeinzWaescher</dc:creator>
      <dc:date>2013-11-28T09:52:01Z</dc:date>
    </item>
    <item>
      <title>Re: Add "Price" field with different values for specific timeranges</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Add-quot-Price-quot-field-with-different-values-for-specific/m-p/159438#M44994</link>
      <description>&lt;P&gt;Heinz&lt;/P&gt;

&lt;P&gt;The Knowledge Manager documentation contains details on setting up a time based lookup. Take a look at &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.0/Knowledge/Addfieldsfromexternaldatasources#Set_up_a_time-based_fields_lookup"&gt;http://docs.splunk.com/Documentation/Splunk/6.0/Knowledge/Addfieldsfromexternaldatasources#Set_up_a_time-based_fields_lookup&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Dave&lt;/P&gt;</description>
      <pubDate>Thu, 28 Nov 2013 10:05:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Add-quot-Price-quot-field-with-different-values-for-specific/m-p/159438#M44994</guid>
      <dc:creator>davebrooking</dc:creator>
      <dc:date>2013-11-28T10:05:02Z</dc:date>
    </item>
    <item>
      <title>Re: Add "Price" field with different values for specific timeranges</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Add-quot-Price-quot-field-with-different-values-for-specific/m-p/159439#M44995</link>
      <description>&lt;P&gt;thanks for the input, I will keep that in mind. But at the moment I would prefer a fast ( and dirty) solution in the search string... &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Nov 2013 10:37:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Add-quot-Price-quot-field-with-different-values-for-specific/m-p/159439#M44995</guid>
      <dc:creator>HeinzWaescher</dc:creator>
      <dc:date>2013-11-28T10:37:35Z</dc:date>
    </item>
    <item>
      <title>Re: Add "Price" field with different values for specific timeranges</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Add-quot-Price-quot-field-with-different-values-for-specific/m-p/159440#M44996</link>
      <description>&lt;P&gt;Is it possible to use something like this?&lt;/P&gt;

&lt;P&gt;| eval price=if(timestamp&amp;lt;1385251200, [|lookup pricelist.csv productname OUTPUT price], null())&lt;/P&gt;

&lt;P&gt;This try returns an error:&lt;/P&gt;

&lt;P&gt;"Error in 'eval' command: The expression is malformed. An unexpected character is reached at ') , null())'"&lt;/P&gt;</description>
      <pubDate>Thu, 28 Nov 2013 10:47:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Add-quot-Price-quot-field-with-different-values-for-specific/m-p/159440#M44996</guid>
      <dc:creator>HeinzWaescher</dc:creator>
      <dc:date>2013-11-28T10:47:16Z</dc:date>
    </item>
    <item>
      <title>Re: Add "Price" field with different values for specific timeranges</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Add-quot-Price-quot-field-with-different-values-for-specific/m-p/159441#M44997</link>
      <description>&lt;P&gt;you cannot use a lookup in an eval.&lt;/P&gt;

&lt;P&gt;if you lookup is timebased (fields _time, productname, price)&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;&amp;lt;mysearchwithfield_timeand_productname&amp;gt; | lookup pricelist.csv _time productname OUTPUT price  | table _time productname price&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 30 Nov 2013 16:53:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Add-quot-Price-quot-field-with-different-values-for-specific/m-p/159441#M44997</guid>
      <dc:creator>yannK</dc:creator>
      <dc:date>2013-11-30T16:53:39Z</dc:date>
    </item>
  </channel>
</rss>

