<?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: Dashboard Search - Include Field When Exists in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/Dashboard-Search-Include-Field-When-Exists/m-p/673271#M55126</link>
    <description>&lt;P&gt;The second part worked great!&amp;nbsp; thank you!&lt;/P&gt;</description>
    <pubDate>Thu, 04 Jan 2024 19:50:07 GMT</pubDate>
    <dc:creator>pkohn117</dc:creator>
    <dc:date>2024-01-04T19:50:07Z</dc:date>
    <item>
      <title>Dashboard Search - Include Field When Exists</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Dashboard-Search-Include-Field-When-Exists/m-p/673235#M55124</link>
      <description>&lt;P&gt;I'm creating a dashboard to easily search through our web proxy logs and table out the results when troubleshooting. The issue is that sometimes the logs don't contain a destination IP, sometimes they do.&lt;/P&gt;
&lt;P&gt;For the dashboard fields that you can input, one of them I want to be able to specify sometimes is the destination IP (field: dest_ip), however, the field doesn't always exist so if I use the following search (I'm excluding the tabling):&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;index=proxy c_ip=$cip$ cs_host=$cshost$ action=$action$ dest_ip=$destip$&lt;/LI-CODE&gt;
&lt;P&gt;Dashboard values:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;c_ip=1.2.3.4

cs_host=* (default)

action=* (default)

dest_ip=* (default)&lt;/LI-CODE&gt;
&lt;P&gt;It will exclude some of the logs since they don't all have the field "dest_ip"&lt;/P&gt;
&lt;P&gt;The other 3 fields exist in all logs.&amp;nbsp; In the dashboard you can input values for each of the fields.&amp;nbsp; I'm trying to allow that for dest_ip but it doesn't always exist - that's the issue I'm trying to overcome.&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jan 2024 16:56:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Dashboard-Search-Include-Field-When-Exists/m-p/673235#M55124</guid>
      <dc:creator>pkohn117</dc:creator>
      <dc:date>2024-01-04T16:56:22Z</dc:date>
    </item>
    <item>
      <title>Re: Dashboard Search - Include Field When Exists</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Dashboard-Search-Include-Field-When-Exists/m-p/673238#M55125</link>
      <description>&lt;P&gt;Does this give you the intended behaviour?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=proxy c_ip=$cip$ cs_host=$cshost$ action=$action$ (dest_ip=$destip$ OR NOT dest_ip=*)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think including an (dest_ip=$destip$ OR NOT dest_ip=*) will search any token input but also include results for events that don't have a dest_ip field in them.&lt;BR /&gt;&lt;BR /&gt;The only issue I see with this is that if a dashboard user is looking for a specific dest_ip now then they will get results matching all the other field criteria and have null dest_ip.&lt;BR /&gt;&lt;BR /&gt;Maybe if you wanted to filter off the events with null dest_ip when a specific dest_ip is being searched (anything other than "*") then you could add some additional filter criteria.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=proxy c_ip=$cip$ cs_host=$cshost$ action=$action$ (dest_ip=$destip$ OR NOT dest_ip=*)
    | eval filter_off=if(NOT "$destip$"=="*" AND isnull(dest_ip), 1, 0)
    | where 'filter_off'==0&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jan 2024 16:08:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Dashboard-Search-Include-Field-When-Exists/m-p/673238#M55125</guid>
      <dc:creator>dtburrows3</dc:creator>
      <dc:date>2024-01-04T16:08:21Z</dc:date>
    </item>
    <item>
      <title>Re: Dashboard Search - Include Field When Exists</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Dashboard-Search-Include-Field-When-Exists/m-p/673271#M55126</link>
      <description>&lt;P&gt;The second part worked great!&amp;nbsp; thank you!&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jan 2024 19:50:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Dashboard-Search-Include-Field-When-Exists/m-p/673271#M55126</guid>
      <dc:creator>pkohn117</dc:creator>
      <dc:date>2024-01-04T19:50:07Z</dc:date>
    </item>
  </channel>
</rss>

