<?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: space in values does not filter data in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/space-in-values-does-not-filter-data/m-p/576875#M201042</link>
    <description>&lt;P&gt;Tried this doing but still not filtering data over dashboard.&lt;/P&gt;</description>
    <pubDate>Wed, 01 Dec 2021 11:30:48 GMT</pubDate>
    <dc:creator>koreamit3483</dc:creator>
    <dc:date>2021-12-01T11:30:48Z</dc:date>
    <item>
      <title>space in values does not filter data</title>
      <link>https://community.splunk.com/t5/Splunk-Search/space-in-values-does-not-filter-data/m-p/576866#M201037</link>
      <description>&lt;P&gt;I have data coming in where I have a field called Result which holds data as below&lt;/P&gt;&lt;P&gt;1) "FAIL"&lt;/P&gt;&lt;P&gt;2) " FAIL "&lt;/P&gt;&lt;P&gt;3) "PASS"&lt;/P&gt;&lt;P&gt;4) " PASS "&lt;/P&gt;&lt;P&gt;now i have created a dashboard where the Result field is used in Drop down box. I have cleared the extra space from the field using&lt;/P&gt;&lt;LI-SPOILER&gt;&lt;LI-SPOILER&gt;|&amp;nbsp;rex mode = sed field=Result "s/ //g"|&lt;/LI-SPOILER&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;in dropdown values.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I have a data also showing on dashboard using the count as&amp;nbsp;&lt;/P&gt;&lt;LI-SPOILER&gt;stats count(eval(searchmatch("PASS"))) AS PASS count(eval(searchmatch("FAIL"))) AS FAIL&lt;P&gt;which also have cleared the space using&amp;nbsp;&lt;/P&gt;&lt;LI-SPOILER&gt;&lt;LI-SPOILER&gt;|&amp;nbsp;rex mode =&amp;nbsp; sed field=Result "s/ //g"|&lt;/LI-SPOILER&gt;&lt;P&gt;but when I select "PASS" or "FAIL" in drop down and submit the data on dashboard, it excludes the data which has values with space in it &lt;STRONG&gt;(i.e. " FAIL " and " PASS ") and shows only the values without space.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;How can I solve this.&lt;/P&gt;&lt;/LI-SPOILER&gt;&lt;/LI-SPOILER&gt;&lt;/LI-SPOILER&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Dec 2021 10:50:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/space-in-values-does-not-filter-data/m-p/576866#M201037</guid>
      <dc:creator>koreamit3483</dc:creator>
      <dc:date>2021-12-01T10:50:46Z</dc:date>
    </item>
    <item>
      <title>Re: space in values does not filter data</title>
      <link>https://community.splunk.com/t5/Splunk-Search/space-in-values-does-not-filter-data/m-p/576870#M201040</link>
      <description>&lt;P&gt;Use&amp;nbsp; |search result=*PASS* OR result=*FAIL* accordingly&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Dec 2021 11:19:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/space-in-values-does-not-filter-data/m-p/576870#M201040</guid>
      <dc:creator>Gr0und_Z3r0</dc:creator>
      <dc:date>2021-12-01T11:19:46Z</dc:date>
    </item>
    <item>
      <title>Re: space in values does not filter data</title>
      <link>https://community.splunk.com/t5/Splunk-Search/space-in-values-does-not-filter-data/m-p/576875#M201042</link>
      <description>&lt;P&gt;Tried this doing but still not filtering data over dashboard.&lt;/P&gt;</description>
      <pubDate>Wed, 01 Dec 2021 11:30:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/space-in-values-does-not-filter-data/m-p/576875#M201042</guid>
      <dc:creator>koreamit3483</dc:creator>
      <dc:date>2021-12-01T11:30:48Z</dc:date>
    </item>
    <item>
      <title>Re: space in values does not filter data</title>
      <link>https://community.splunk.com/t5/Splunk-Search/space-in-values-does-not-filter-data/m-p/577005#M201095</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/241145"&gt;@koreamit3483&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;I have data coming in where I have a field called Result which holds data as below&lt;/P&gt;&lt;P&gt;1) "FAIL"&lt;/P&gt;&lt;P&gt;2) " FAIL "&lt;/P&gt;&lt;P&gt;3) "PASS"&lt;/P&gt;&lt;P&gt;4) " PASS "&lt;/P&gt;&lt;P&gt;now i have created a dashboard where the Result field is used in Drop down box. I have cleared the extra space from the field using&lt;/P&gt;|&amp;nbsp;rex mode = sed field=Result "s/ //g"|&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;in dropdown values.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I have a data also showing on dashboard using the count as&amp;nbsp;&lt;/P&gt;stats count(eval(searchmatch("PASS"))) AS PASS count(eval(searchmatch("FAIL"))) AS FAIL&lt;P&gt;which also have cleared the space using&amp;nbsp;&lt;/P&gt;|&amp;nbsp;rex mode =&amp;nbsp; sed field=Result "s/ //g"|&lt;P&gt;but when I select "PASS" or "FAIL" in drop down and submit the data on dashboard, it excludes the data which has values with space in it &lt;STRONG&gt;(i.e. " FAIL " and " PASS ") and shows only the values without space.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;How can I solve this.&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;(Nested Spoiler tags make the question very difficult to read. &amp;nbsp;Additionally, if you illustrate actual search terms in your dashboard search, the question will be much clearer; specifically, illustrate how the dropdown token is being used &amp;nbsp;in the search.)&lt;/P&gt;&lt;P&gt;Suppose your dropdown token is &lt;FONT face="comic sans ms,sans-serif"&gt;$results_tok$&lt;/FONT&gt;&amp;nbsp;and your dashboard search is something like&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Results = $results_tok$ blah
``` token used in base search without modification will fail to capture events with space in Results ```
| stats blah&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;it will only get events without space. &amp;nbsp;This is expected.&lt;/P&gt;&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/240999"&gt;@Gr0und_Z3r0&lt;/a&gt;&amp;nbsp;suggests using "*" wildcard. &amp;nbsp;It &lt;EM&gt;should&lt;/EM&gt; work in base search, e.g.,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Results = $results_tok$* blah
| stats blah&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In short, you need to illustrate sanitized search code for others to diagnose a problem.&lt;/P&gt;&lt;P&gt;Here is an emulation of the solution suggested by Gr0und_Z3r0.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults count=16 ``` emulating raw events ```
| streamstats count
| eval Result = if(count % 2 == 0, "PASS", "FAIL")
| eval Result = if(count % 4 == 0, Result  .  " ", Result)
| eval result = "&amp;gt;" . Result . "&amp;lt;"

``` the following emulates base search where dropdown token value is "PASS" ```
| search Result = PASS*&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The result includes both "PASS" and "PASS "&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Result&lt;/TD&gt;&lt;TD&gt;_time&lt;/TD&gt;&lt;TD&gt;count&lt;/TD&gt;&lt;TD&gt;result&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;PASS&lt;/TD&gt;&lt;TD&gt;2021-12-02 00:54:03&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;&amp;gt;PASS&amp;lt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;PASS&lt;/TD&gt;&lt;TD&gt;2021-12-02 00:54:03&lt;/TD&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;TD&gt;&amp;gt;PASS &amp;lt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;PASS&lt;/TD&gt;&lt;TD&gt;2021-12-02 00:54:03&lt;/TD&gt;&lt;TD&gt;6&lt;/TD&gt;&lt;TD&gt;&amp;gt;PASS&amp;lt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;PASS&lt;/TD&gt;&lt;TD&gt;2021-12-02 00:54:03&lt;/TD&gt;&lt;TD&gt;8&lt;/TD&gt;&lt;TD&gt;&amp;gt;PASS &amp;lt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;PASS&lt;/TD&gt;&lt;TD&gt;2021-12-02 00:54:03&lt;/TD&gt;&lt;TD&gt;10&lt;/TD&gt;&lt;TD&gt;&amp;gt;PASS&amp;lt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;PASS&lt;/TD&gt;&lt;TD&gt;2021-12-02 00:54:03&lt;/TD&gt;&lt;TD&gt;12&lt;/TD&gt;&lt;TD&gt;&amp;gt;PASS &amp;lt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;PASS&lt;/TD&gt;&lt;TD&gt;2021-12-02 00:54:03&lt;/TD&gt;&lt;TD&gt;14&lt;/TD&gt;&lt;TD&gt;&amp;gt;PASS&amp;lt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;PASS&lt;/TD&gt;&lt;TD&gt;2021-12-02 00:54:03&lt;/TD&gt;&lt;TD&gt;16&lt;/TD&gt;&lt;TD&gt;&amp;gt;PASS &amp;lt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Thu, 02 Dec 2021 08:57:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/space-in-values-does-not-filter-data/m-p/577005#M201095</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2021-12-02T08:57:36Z</dc:date>
    </item>
  </channel>
</rss>

