<?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 Re: Is it possible to use a value in a lookup in order to automatically adjust the time range a scheduled search runs? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-use-a-value-in-a-lookup-in-order-to/m-p/280043#M84540</link>
    <description>&lt;P&gt;Try like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your base search [| inputlookup my_lookup.csv | eval earliest="@mon-".adjust."mon" | eval latest="@mon+1mon-".adjust."mon" | table earliest latest ] | rest of the search
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;OR &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your base search [| inputlookup my_lookup.csv | eval earliest="@mon-".adjust."mon" | eval latest="@mon+1mon-".adjust."mon" | table earliest latest | format "" "" "" "" "" ""] | rest of the search
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 14 Dec 2016 17:16:06 GMT</pubDate>
    <dc:creator>somesoni2</dc:creator>
    <dc:date>2016-12-14T17:16:06Z</dc:date>
    <item>
      <title>Is it possible to use a value in a lookup in order to automatically adjust the time range a scheduled search runs?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-use-a-value-in-a-lookup-in-order-to/m-p/280042#M84539</link>
      <description>&lt;P&gt;I have a scheduled report, which is generating a lookup table. In this lookup csv, there is a field called "adjust", which will only ever have a value of 0 or 1.&lt;/P&gt;

&lt;P&gt;I'm building a second scheduled report, and I'd like the time range of this scheduled report to be dynamic, based on the value of the "adjust" field from the lookup csv above.&lt;/P&gt;

&lt;P&gt;Rough example: &lt;CODE&gt;earliest=@mon-"adjust"mon latest=@mon+1mon-"adjust"mon&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Therefore if "adjust"=0 the range will be this month, and if "adjust"=1 the range will be last month.&lt;/P&gt;

&lt;P&gt;Any ideas?&lt;/P&gt;

&lt;P&gt;When I try:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;earliest=@mon-[|inputlookup my_lookup.csv | return adjust]mon latest=@mon+1mon-[|inputlookup my_lookup.csv | return adjust]mon
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I get the error:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Invalid value "@mon-" for time term 'earliest'
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Thanks for any help!&lt;/P&gt;</description>
      <pubDate>Wed, 14 Dec 2016 16:50:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-use-a-value-in-a-lookup-in-order-to/m-p/280042#M84539</guid>
      <dc:creator>adamsmith47</dc:creator>
      <dc:date>2016-12-14T16:50:51Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to use a value in a lookup in order to automatically adjust the time range a scheduled search runs?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-use-a-value-in-a-lookup-in-order-to/m-p/280043#M84540</link>
      <description>&lt;P&gt;Try like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your base search [| inputlookup my_lookup.csv | eval earliest="@mon-".adjust."mon" | eval latest="@mon+1mon-".adjust."mon" | table earliest latest ] | rest of the search
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;OR &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your base search [| inputlookup my_lookup.csv | eval earliest="@mon-".adjust."mon" | eval latest="@mon+1mon-".adjust."mon" | table earliest latest | format "" "" "" "" "" ""] | rest of the search
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 14 Dec 2016 17:16:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-use-a-value-in-a-lookup-in-order-to/m-p/280043#M84540</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-12-14T17:16:06Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to use a value in a lookup in order to automatically adjust the time range a scheduled search runs?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-use-a-value-in-a-lookup-in-order-to/m-p/280044#M84541</link>
      <description>&lt;P&gt;Your second suggestion works beautifully. We wouldn't have come up with that on our own. Thank you!&lt;/P&gt;</description>
      <pubDate>Wed, 14 Dec 2016 18:22:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-it-possible-to-use-a-value-in-a-lookup-in-order-to/m-p/280044#M84541</guid>
      <dc:creator>adamsmith47</dc:creator>
      <dc:date>2016-12-14T18:22:26Z</dc:date>
    </item>
  </channel>
</rss>

