<?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: Lookup based on if statement in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Lookup-based-on-if-statement/m-p/448401#M127044</link>
    <description>&lt;P&gt;Like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | lookup myacmelookup.csv IP AS TID
| eval TID=coalesce(HOST, TID)
| fields - HOST
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 15 Aug 2019 22:37:37 GMT</pubDate>
    <dc:creator>woodcock</dc:creator>
    <dc:date>2019-08-15T22:37:37Z</dc:date>
    <item>
      <title>Lookup based on if statement</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Lookup-based-on-if-statement/m-p/448400#M127043</link>
      <description>&lt;P&gt;I am looking to enhance a search with a lookup (if it returns an IP) to replace the value returned in the TID field if it matches an IP instead of a DNS name. &lt;/P&gt;

&lt;P&gt;I am experimenting with the following but not sure how to do the lookup correctly if the if statement returns a "yes" (or if using eval is even the best method)&lt;/P&gt;

&lt;P&gt;| eval TID=if(cidrmatch("10.0.0.0/8", ),  , TID)&lt;/P&gt;

&lt;P&gt;Ex:&lt;BR /&gt;
TID: myhostname.acmerocket.com (Do nothing)&lt;/P&gt;

&lt;P&gt;TID: 10.100.0.1 (Replace with hostname from myacmelookup.csv)&lt;/P&gt;

&lt;P&gt;Examples of possible fields in myacmelookup.csv&lt;/P&gt;

&lt;P&gt;IP: 10.100.0.1&lt;BR /&gt;&lt;BR /&gt;
HOST: coyote.acmerocket.com&lt;/P&gt;

&lt;P&gt;IP: 10.100.0.2&lt;BR /&gt;
HOST: myhostname.acmerocket.com&lt;/P&gt;</description>
      <pubDate>Thu, 15 Aug 2019 21:58:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Lookup-based-on-if-statement/m-p/448400#M127043</guid>
      <dc:creator>donemery</dc:creator>
      <dc:date>2019-08-15T21:58:32Z</dc:date>
    </item>
    <item>
      <title>Re: Lookup based on if statement</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Lookup-based-on-if-statement/m-p/448401#M127044</link>
      <description>&lt;P&gt;Like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | lookup myacmelookup.csv IP AS TID
| eval TID=coalesce(HOST, TID)
| fields - HOST
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 15 Aug 2019 22:37:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Lookup-based-on-if-statement/m-p/448401#M127044</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-08-15T22:37:37Z</dc:date>
    </item>
    <item>
      <title>Re: Lookup based on if statement</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Lookup-based-on-if-statement/m-p/448402#M127045</link>
      <description>&lt;P&gt;Thanks for your help!&lt;/P&gt;</description>
      <pubDate>Wed, 21 Aug 2019 16:56:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Lookup-based-on-if-statement/m-p/448402#M127045</guid>
      <dc:creator>donemery</dc:creator>
      <dc:date>2019-08-21T16:56:03Z</dc:date>
    </item>
  </channel>
</rss>

