<?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 with if statement through eval. in Splunk Enterprise</title>
    <link>https://community.splunk.com/t5/Splunk-Enterprise/lookup-with-if-statement-through-eval/m-p/560258#M6467</link>
    <description>&lt;DIV class="lia-message-body lia-component-message-view-widget-body lia-component-body-signature-highlight-escalation lia-component-message-view-widget-body-signature-highlight-escalation"&gt;&lt;DIV class="lia-message-body-content"&gt;&lt;P&gt;then it is not matching and also not printing the "yes" , it should print "yes" if raw logs has any of the buckets in buckets.csv it is only printing "no"&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class="lia-panel lia-panel-standard MessageTagsTaplet Chrome lia-component-message-view-widget-tags"&gt;&lt;DIV class="lia-decoration-border"&gt;&lt;DIV class="lia-decoration-border-top"&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class="lia-decoration-border-content"&gt;&lt;DIV&gt;&lt;DIV class="lia-panel-content-wrapper"&gt;&lt;DIV class="lia-panel-content"&gt;&lt;DIV class="AddMessageTags lia-message-tags"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
    <pubDate>Tue, 20 Jul 2021 20:06:20 GMT</pubDate>
    <dc:creator>rahul_mckc_splu</dc:creator>
    <dc:date>2021-07-20T20:06:20Z</dc:date>
    <item>
      <title>lookup with if statement through eval.</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/lookup-with-if-statement-through-eval/m-p/560233#M6461</link>
      <description>&lt;P&gt;Here is my search&amp;nbsp;&lt;/P&gt;&lt;P&gt;index=abc Status=FAILED | eval exception =if(bucket_name=s3-abc, "yes","no") | stats count by bucket_name exception&lt;/P&gt;&lt;P&gt;now if my bucket name is s3-abc, it would print&amp;nbsp;bucket_name=s3-abc and exception=yes, rest all buckets will fall under&amp;nbsp;exception=no.&lt;/P&gt;&lt;P&gt;Now i need to do this task through a lookup, i have a lookup which is buckets.csv and fields is there bucket_name, so I need to see that lookup if the bucket is there then it should print&amp;nbsp;exception=yes rest it should print&amp;nbsp;exception=no. i am doing like this but not getting anything&lt;/P&gt;&lt;P&gt;index=abc Status=FAILED | eval exception =if(|search [|inputlookup bucket.csv |fields bucket_name], "yes","no") | stats count by bucket_name exception&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Jul 2021 17:12:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/lookup-with-if-statement-through-eval/m-p/560233#M6461</guid>
      <dc:creator>rahul_mckc_splu</dc:creator>
      <dc:date>2021-07-20T17:12:40Z</dc:date>
    </item>
    <item>
      <title>Re: lookup with if statement through eval.</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/lookup-with-if-statement-through-eval/m-p/560236#M6462</link>
      <description>&lt;P&gt;If you csv has bucket_name and exception (always set to "yes") you could try this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=abc Status=FAILED 
| lookup bucket.csv
| fillnull value="no" exception
| stats count by bucket_name exception&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 20 Jul 2021 17:22:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/lookup-with-if-statement-through-eval/m-p/560236#M6462</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-07-20T17:22:17Z</dc:date>
    </item>
    <item>
      <title>Re: lookup with if statement through eval.</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/lookup-with-if-statement-through-eval/m-p/560243#M6464</link>
      <description>&lt;P&gt;no, it does not seems to be the solution. if you can read what I want.&lt;/P&gt;&lt;P&gt;i need to match my lookup then print "yes" or "no" depends upon if that field value exist.&lt;/P&gt;</description>
      <pubDate>Tue, 20 Jul 2021 18:06:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/lookup-with-if-statement-through-eval/m-p/560243#M6464</guid>
      <dc:creator>rahul_mckc_splu</dc:creator>
      <dc:date>2021-07-20T18:06:39Z</dc:date>
    </item>
    <item>
      <title>Re: lookup with if statement through eval.</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/lookup-with-if-statement-through-eval/m-p/560253#M6465</link>
      <description>&lt;P&gt;You said you need to find out if bucket name exists in your bucket.csv - this is what lookup does, however, you need a field to look up from the csv, so why not make it exception so the lookup will return exception as yes if it exists in the csv. If this isn't returned, exception will be null, so fillnull can set the nulls to no. Doesn't this get you to the position you wanted i.e. all buckets in the csv will have exception set to yes and all those not in the csv will have exception set to no. If this is not what you are after, please explain your request more clearly.&lt;/P&gt;</description>
      <pubDate>Tue, 20 Jul 2021 19:40:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/lookup-with-if-statement-through-eval/m-p/560253#M6465</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-07-20T19:40:42Z</dc:date>
    </item>
    <item>
      <title>Re: lookup with if statement through eval.</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/lookup-with-if-statement-through-eval/m-p/560257#M6466</link>
      <description>&lt;P&gt;Here is my search&amp;nbsp;&lt;/P&gt;&lt;P&gt;index=abc Status=FAILED | eval exception =if(bucket_name=s3-abc, "yes","no") | stats count by bucket_name exception&lt;/P&gt;&lt;P&gt;now if my bucket name is s3-abc, it would print&amp;nbsp;bucket_name=s3-abc and exception=yes, rest all buckets will fall under&amp;nbsp;exception=no.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now i have lookup like this&lt;/P&gt;&lt;P&gt;bucket_name&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="100%"&gt;bucket_name&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="100%"&gt;s3-abc&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="100%"&gt;s3-bcd&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="100%"&gt;&amp;nbsp;s3-bcw&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;so I need to see that lookup, if the bucket is there then it should print&amp;nbsp;exception=yes rest it should print&amp;nbsp;exception=no. i am doing like this but not getting anything&lt;/P&gt;&lt;P&gt;iindex=abc Status=FAILED&amp;nbsp; | lookup bucket.csv bucket_name| fillnull value="no" exception | stats count by bucket_name exception&lt;/P&gt;&lt;P&gt;then it is not matching and also printing the "yes" it should print if raw logs has any of the buckets in buckets.csv&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Jul 2021 20:04:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/lookup-with-if-statement-through-eval/m-p/560257#M6466</guid>
      <dc:creator>rahul_mckc_splu</dc:creator>
      <dc:date>2021-07-20T20:04:12Z</dc:date>
    </item>
    <item>
      <title>Re: lookup with if statement through eval.</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/lookup-with-if-statement-through-eval/m-p/560258#M6467</link>
      <description>&lt;DIV class="lia-message-body lia-component-message-view-widget-body lia-component-body-signature-highlight-escalation lia-component-message-view-widget-body-signature-highlight-escalation"&gt;&lt;DIV class="lia-message-body-content"&gt;&lt;P&gt;then it is not matching and also not printing the "yes" , it should print "yes" if raw logs has any of the buckets in buckets.csv it is only printing "no"&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class="lia-panel lia-panel-standard MessageTagsTaplet Chrome lia-component-message-view-widget-tags"&gt;&lt;DIV class="lia-decoration-border"&gt;&lt;DIV class="lia-decoration-border-top"&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV class="lia-decoration-border-content"&gt;&lt;DIV&gt;&lt;DIV class="lia-panel-content-wrapper"&gt;&lt;DIV class="lia-panel-content"&gt;&lt;DIV class="AddMessageTags lia-message-tags"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 20 Jul 2021 20:06:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/lookup-with-if-statement-through-eval/m-p/560258#M6467</guid>
      <dc:creator>rahul_mckc_splu</dc:creator>
      <dc:date>2021-07-20T20:06:20Z</dc:date>
    </item>
    <item>
      <title>Re: lookup with if statement through eval.</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/lookup-with-if-statement-through-eval/m-p/560259#M6468</link>
      <description>&lt;P&gt;Can you change your lookup so it is like this?&lt;/P&gt;&lt;TABLE border="1" width="221.8549747048904px"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="110.912px"&gt;bucket_name&lt;/TD&gt;&lt;TD width="109.938px"&gt;exception&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="110.912px"&gt;s3-abc&lt;/TD&gt;&lt;TD width="109.938px"&gt;yes&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="110.912px"&gt;s3-bcd&lt;/TD&gt;&lt;TD width="109.938px"&gt;yes&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="110.912px"&gt;&amp;nbsp;s3-bcw&lt;/TD&gt;&lt;TD width="109.938px"&gt;yes&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Tue, 20 Jul 2021 20:10:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/lookup-with-if-statement-through-eval/m-p/560259#M6468</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-07-20T20:10:15Z</dc:date>
    </item>
    <item>
      <title>Re: lookup with if statement through eval.</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/lookup-with-if-statement-through-eval/m-p/560260#M6469</link>
      <description>&lt;P&gt;My lookup does not have any exception field, and it would not have it. The reason of printing yes and no is to have match field name in lookup.&lt;/P&gt;</description>
      <pubDate>Tue, 20 Jul 2021 20:13:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/lookup-with-if-statement-through-eval/m-p/560260#M6469</guid>
      <dc:creator>rahul_mckc_splu</dc:creator>
      <dc:date>2021-07-20T20:13:04Z</dc:date>
    </item>
    <item>
      <title>Re: lookup with if statement through eval.</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/lookup-with-if-statement-through-eval/m-p/560263#M6470</link>
      <description>&lt;P&gt;i have 10000 records in raw logs, and i can't maintain all field names in lookup, so i have almost 20-25 exceptions which i am handling in a lookup, and trying to match those in raw logs to have exception printed as "yes" or "no".&lt;/P&gt;</description>
      <pubDate>Tue, 20 Jul 2021 20:15:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/lookup-with-if-statement-through-eval/m-p/560263#M6470</guid>
      <dc:creator>rahul_mckc_splu</dc:creator>
      <dc:date>2021-07-20T20:15:33Z</dc:date>
    </item>
    <item>
      <title>Re: lookup with if statement through eval.</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/lookup-with-if-statement-through-eval/m-p/560264#M6471</link>
      <description>&lt;P&gt;Try this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=abc Status=FAILED
| join type=left bucket_name [| inputlookup bucket.csv | eval exception="yes"]
| fillnull value="no" exception
| stats count by bucket_name exception&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 20 Jul 2021 20:26:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/lookup-with-if-statement-through-eval/m-p/560264#M6471</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-07-20T20:26:55Z</dc:date>
    </item>
    <item>
      <title>Re: lookup with if statement through eval.</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/lookup-with-if-statement-through-eval/m-p/560265#M6472</link>
      <description>&lt;P&gt;worked..thanks alot&lt;/P&gt;</description>
      <pubDate>Tue, 20 Jul 2021 20:29:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/lookup-with-if-statement-through-eval/m-p/560265#M6472</guid>
      <dc:creator>rahul_mckc_splu</dc:creator>
      <dc:date>2021-07-20T20:29:45Z</dc:date>
    </item>
  </channel>
</rss>

