<?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: Question about SPL using data from a lookup in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/Question-about-SPL-using-data-from-a-lookup/m-p/564505#M46415</link>
    <description>&lt;P&gt;Hi &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/129090"&gt;@manjunathmeti&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your reply but my question was actually about how to deal with a column having multiple valid values, one value per line (so far, we've dealing with only 1 entry).&lt;/P&gt;&lt;P&gt;I think the "eval" should be adapted to cope with that. Can you help ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 24 Aug 2021 10:44:17 GMT</pubDate>
    <dc:creator>PNG</dc:creator>
    <dc:date>2021-08-24T10:44:17Z</dc:date>
    <item>
      <title>Question about SPL using data from a lookup</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Question-about-SPL-using-data-from-a-lookup/m-p/564477#M46413</link>
      <description>&lt;P&gt;We’re running Splunk 8.1.2 on RHEL 8.x and are using some dashboards that makes use of a lookup file “itsp_compliance_settings.csv” with an exemple below&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;host_environment,title,setting,must,value&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;…&lt;/P&gt;&lt;P&gt;Production,IP default-gateway,default_gateway,equal,&lt;A href="https://protect-eu.mimecast.com/s/91YpCKOgvF4Dq9RWCGUOOu?domain=1.2.3.4" target="_blank" rel="noopener"&gt;1.2.3.4&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Production,IP default-gateway,default_gateway,equal,&lt;A href="https://protect-eu.mimecast.com/s/oHpoCLgjwsQkPXz9crr5Ao?domain=5.6.7.9" target="_blank" rel="noopener"&gt;5.6.7.9&lt;/A&gt;&lt;/P&gt;&lt;P&gt;…&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is an extract of the search behind the dashboard using the above lookup&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;index="cisco_ios_config" sourcetype="ApplianceConfigurations:Cisco:IOS"&lt;BR /&gt;| dedup host&lt;BR /&gt;| fields - tag, -_raw, - tag::eventtype&lt;BR /&gt;| rex field=source "\/usr\/local\/rancid\/var\/(?&amp;lt;host_environment&amp;gt;\w+)\/configs\/"&lt;BR /&gt;| rex field=source "\/usr\/local\/rancid\/var\/\w+\/configs\/\w+-\w+-(?&amp;lt;extra_host_environment_check&amp;gt;\w+)-"&lt;BR /&gt;| lookup ITSP:Compliance_Settings host_environment&lt;BR /&gt;| eval zip=mvzip(title, setting, "||")&lt;BR /&gt;| eval zip=mvzip(zip, must, "||")&lt;BR /&gt;| eval zip=mvzip(zip, value, "||")&lt;BR /&gt;| mvexpand zip&lt;BR /&gt;| makemv delim="||" zip&lt;BR /&gt;| eval title=mvindex(zip,0)&lt;BR /&gt;| eval setting=mvindex(zip,1)&lt;BR /&gt;| eval must=mvindex(zip,2)&lt;BR /&gt;| eval value=mvindex(zip,3)&lt;BR /&gt;| foreach *&lt;BR /&gt;[ eval field=if("&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;"==setting,&amp;lt;&amp;lt;MATCHSTR&amp;gt;&amp;gt;,field)]&lt;BR /&gt;| fillnull value="Setting not found" field&lt;BR /&gt;| mvexpand field&lt;BR /&gt;| eval fail=if(trim(field)==trim(value),if(must=="equal",0,1),if(must=="equal",1,0)) | stats sum(fail) AS "Count" by title&lt;BR /&gt;| rename title AS "Setting"&lt;BR /&gt;| eval Status=if(Count &amp;gt; 0, "error", "ok")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can someone please help and tell me if this is possible to adapt the search to take into account more than 1 possible values (2 default gateways are both valid) in the lookup as per the above example ?&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 24 Aug 2021 07:42:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Question-about-SPL-using-data-from-a-lookup/m-p/564477#M46413</guid>
      <dc:creator>PNG</dc:creator>
      <dc:date>2021-08-24T07:42:26Z</dc:date>
    </item>
    <item>
      <title>Re: Question about SPL using data from a lookup</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Question-about-SPL-using-data-from-a-lookup/m-p/564493#M46414</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/237727"&gt;@PNG&lt;/a&gt;,&lt;BR /&gt;&lt;BR /&gt;Your query will not work if one of the columns contains blank values in csv file. Try this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index="cisco_ios_config" sourcetype="ApplianceConfigurations:Cisco:IOS"
| dedup host
| fields - tag, -_raw, - tag::eventtype
| rex field=source "\/usr\/local\/rancid\/var\/(?&amp;lt;host_environment&amp;gt;\w+)\/configs\/"
| rex field=source "\/usr\/local\/rancid\/var\/\w+\/configs\/\w+-\w+-(?&amp;lt;extra_host_environment_check&amp;gt;\w+)-"
| append [ | inputlookup ITSP:Compliance_Settings] | stats latest(_time) as _time, max(*) as * by host_environment,title,setting,must,value
| foreach *
[ eval field=if("&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;"==setting,&amp;lt;&amp;lt;MATCHSTR&amp;gt;&amp;gt;,field)]
| fillnull value="Setting not found" field
| mvexpand field
| eval fail=if(trim(field)==trim(value),if(must=="equal",0,1),if(must=="equal",1,0)) | stats sum(fail) AS "Count" by title
| rename title AS "Setting"
| eval Status=if(Count &amp;gt; 0, "error", "ok")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If this reply helps you, a like would be appreciated.&lt;/P&gt;</description>
      <pubDate>Tue, 24 Aug 2021 08:45:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Question-about-SPL-using-data-from-a-lookup/m-p/564493#M46414</guid>
      <dc:creator>manjunathmeti</dc:creator>
      <dc:date>2021-08-24T08:45:28Z</dc:date>
    </item>
    <item>
      <title>Re: Question about SPL using data from a lookup</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Question-about-SPL-using-data-from-a-lookup/m-p/564505#M46415</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/129090"&gt;@manjunathmeti&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your reply but my question was actually about how to deal with a column having multiple valid values, one value per line (so far, we've dealing with only 1 entry).&lt;/P&gt;&lt;P&gt;I think the "eval" should be adapted to cope with that. Can you help ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Aug 2021 10:44:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Question-about-SPL-using-data-from-a-lookup/m-p/564505#M46415</guid>
      <dc:creator>PNG</dc:creator>
      <dc:date>2021-08-24T10:44:17Z</dc:date>
    </item>
  </channel>
</rss>

