<?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: How to filter rows based on a regex match on all fields? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-filter-rows-based-on-a-regex-match-on-all-fields/m-p/518989#M146129</link>
    <description>&lt;P&gt;regex is applied on the field (if you specify) or on the _raw event by default .&lt;/P&gt;&lt;P&gt;Is your fields extracted ? Is it possible to apply the filter on the _raw in the base search part ?&lt;/P&gt;&lt;P&gt;e.g.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults |eval _raw="wewillsearchfor-this-intheevent"
|regex "this"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 11 Sep 2020 04:59:41 GMT</pubDate>
    <dc:creator>renjith_nair</dc:creator>
    <dc:date>2020-09-11T04:59:41Z</dc:date>
    <item>
      <title>How to filter rows based on a regex match on all fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-filter-rows-based-on-a-regex-match-on-all-fields/m-p/518982#M146128</link>
      <description>&lt;P&gt;Is it possible to filter search result rows by a search expression which can be applied to all fields of a row?&lt;/P&gt;&lt;P&gt;According to the &lt;A href="https://docs.splunk.com/Documentation/Splunk/8.0.6/SearchReference/Regex" target="_self"&gt;documentation for regex&lt;/A&gt;&amp;nbsp;it appears you should be able to use it without specifying a field:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;| ...
| regex "some regex search string"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However when I give it a try, it yields no results.&lt;/P&gt;&lt;P&gt;I did find this while searching the internet:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;| ...
| eval matchCount=0
| foreach * [eval matchCount = matchCount + if(match(&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;, "my regex search string"), 1, 0) ]
| where matchCount &amp;gt; 0&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;However I was wondering if there was a way to do this without adding the 'matchCount' column.&lt;/P&gt;</description>
      <pubDate>Fri, 11 Sep 2020 02:31:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-filter-rows-based-on-a-regex-match-on-all-fields/m-p/518982#M146128</guid>
      <dc:creator>DanK</dc:creator>
      <dc:date>2020-09-11T02:31:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter rows based on a regex match on all fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-filter-rows-based-on-a-regex-match-on-all-fields/m-p/518989#M146129</link>
      <description>&lt;P&gt;regex is applied on the field (if you specify) or on the _raw event by default .&lt;/P&gt;&lt;P&gt;Is your fields extracted ? Is it possible to apply the filter on the _raw in the base search part ?&lt;/P&gt;&lt;P&gt;e.g.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults |eval _raw="wewillsearchfor-this-intheevent"
|regex "this"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 11 Sep 2020 04:59:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-filter-rows-based-on-a-regex-match-on-all-fields/m-p/518989#M146129</guid>
      <dc:creator>renjith_nair</dc:creator>
      <dc:date>2020-09-11T04:59:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter rows based on a regex match on all fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-filter-rows-based-on-a-regex-match-on-all-fields/m-p/518994#M146132</link>
      <description>&lt;P&gt;Sorry i'm not super familiar with events but I don't believe i'm using them. The data source is from JDBC &amp;lt;-&amp;gt; MongoDB and is being accessed via:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;| dbxquery query="SELECT ..."&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Under the Search tool, results only appear under 'Statistics' and not 'Events'.&lt;/P&gt;&lt;P&gt;I'm also using this in the dashboard. I just tried the alternative I mentioned above and it doesn't seem to work. I am able to get it to work under the Search tool though.&lt;/P&gt;&lt;P&gt;Unfortunately, your suggestion of using _raw doesn't work. I tried the following but I get no result.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| dbxquery ...
| regex _raw="some regex"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a way to | eval each row of data into a field so that i can do a regex search on that field?&lt;/P&gt;</description>
      <pubDate>Fri, 11 Sep 2020 05:31:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-filter-rows-based-on-a-regex-match-on-all-fields/m-p/518994#M146132</guid>
      <dc:creator>DanK</dc:creator>
      <dc:date>2020-09-11T05:31:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter rows based on a regex match on all fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-filter-rows-based-on-a-regex-match-on-all-fields/m-p/519040#M146148</link>
      <description>&lt;P&gt;Ok if its extracted using dbConnect _raw will not work.&lt;/P&gt;&lt;P&gt;What's the issue while using the &lt;EM&gt;foreach &lt;/EM&gt;solution? If its just about additional field, either you can remove it by &lt;EM&gt;fields - matchCount &lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 11 Sep 2020 10:28:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-filter-rows-based-on-a-regex-match-on-all-fields/m-p/519040#M146148</guid>
      <dc:creator>renjith_nair</dc:creator>
      <dc:date>2020-09-11T10:28:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter rows based on a regex match on all fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-filter-rows-based-on-a-regex-match-on-all-fields/m-p/519063#M146150</link>
      <description>Or should you change that dbxquery to avoid that kind of rows which you want throw away?&lt;BR /&gt;r. Ismo</description>
      <pubDate>Fri, 11 Sep 2020 13:29:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-filter-rows-based-on-a-regex-match-on-all-fields/m-p/519063#M146150</guid>
      <dc:creator>isoutamo</dc:creator>
      <dc:date>2020-09-11T13:29:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter rows based on a regex match on all fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-filter-rows-based-on-a-regex-match-on-all-fields/m-p/519084#M146156</link>
      <description>&lt;P&gt;That's definitely an option but I consider it the last resort.&lt;/P&gt;&lt;P&gt;The reason for this is because I use the search as a base search for multiple panels in the dashboard. It's a larger more complex search so following the DRY principle I'd rather not copy it with slight modifications when there's an opportunity to add a filter to it.&lt;/P&gt;</description>
      <pubDate>Fri, 11 Sep 2020 15:14:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-filter-rows-based-on-a-regex-match-on-all-fields/m-p/519084#M146156</guid>
      <dc:creator>DanK</dc:creator>
      <dc:date>2020-09-11T15:14:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter rows based on a regex match on all fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-filter-rows-based-on-a-regex-match-on-all-fields/m-p/519096#M146158</link>
      <description>&lt;P&gt;Unfortunately the issue isn't with the additional field. Removing it is fine and it's what I've been trying to do, but although the search works in the Search application, the exact same query doesn't work in the dashboard.&lt;/P&gt;&lt;P&gt;So this is working in Search:&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;| dbxquery query="SELECT ..." connection="..."
| where match(Status, ".*")
| eval matchCount = 0
| foreach * [eval matchCount = matchCount + if(match(&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;, ".*"), 1, 0)]&lt;/LI-CODE&gt;&lt;P&gt;but this is not in dashboard:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;form&amp;gt;
  &amp;lt;search id="mySearch"&amp;gt;
    &amp;lt;query&amp;gt;
      | dbxquery ...
    &amp;lt;/query&amp;gt;
  &amp;lt;/search&amp;gt;
  ...
  &amp;lt;row&amp;gt;
    &amp;lt;panel&amp;gt;
      ...
      &amp;lt;table&amp;gt;
        &amp;lt;search base="mySearch"&amp;gt;
          &amp;lt;query&amp;gt;
            | eval textSearchMatchCount = 0
            | foreach * [eval textSearchMatchCount = textSearchMatchCount + if(match(&amp;amp;lt;&amp;amp;lt;FIELD&amp;gt;&amp;gt;, "$textSearchFilter$"), 1, 0)]
            | where textSearchMatchCount &amp;gt; 1
            | fields - textSearchMatchCount
          &amp;lt;/query&amp;gt;
        &amp;lt;/search&amp;gt;
      &amp;lt;/table&amp;gt;
    &amp;lt;/panel&amp;gt;
  &amp;lt;/row&amp;gt;
&amp;lt;/form&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;The dashboard was complaining about the two lesser-than characters of &amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt; so i replaced then with &amp;amp;lt;. This works fine when either "" or ".*" string is used as the value of the $textSearchFilter$ token, but if I put a single other character, such as "P", there are zero results. Even "^.*$" works, but not "^.*P.*$" even though there are columns with the P character in them.&lt;/P&gt;</description>
      <pubDate>Fri, 11 Sep 2020 15:05:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-filter-rows-based-on-a-regex-match-on-all-fields/m-p/519096#M146158</guid>
      <dc:creator>DanK</dc:creator>
      <dc:date>2020-09-11T15:05:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter rows based on a regex match on all fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-filter-rows-based-on-a-regex-match-on-all-fields/m-p/519108#M146161</link>
      <description>You could surround your query by &amp;lt;![CDATA[ ..... ]]&amp;gt; to keep it more readable without use escaping characters.&lt;BR /&gt;Can you try ‘&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;’ if those fields contains e.g. “.” ?</description>
      <pubDate>Fri, 11 Sep 2020 15:32:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-filter-rows-based-on-a-regex-match-on-all-fields/m-p/519108#M146161</guid>
      <dc:creator>isoutamo</dc:creator>
      <dc:date>2020-09-11T15:32:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter rows based on a regex match on all fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-filter-rows-based-on-a-regex-match-on-all-fields/m-p/519130#M146166</link>
      <description>&lt;P&gt;Thanks for the&amp;nbsp;&lt;SPAN&gt;&amp;lt;![CDATA[ ..... ]]&amp;gt; suggestion! It works great!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I tried surrounding the &amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt; with single and double-quotes but it didn't make a difference. None of the field names have a period in it.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;One thing I did notice though is that the search itself seems to tries to match against the field name instead of the field value. I tried a character 'S' in my search and it matched with every data row, but the value of the match column is '2' which is the same number of column names which have the 'S' character in them.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;This is different from the behaviour in the Search app, perhaps this is a known difference or a bug.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 11 Sep 2020 16:17:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-filter-rows-based-on-a-regex-match-on-all-fields/m-p/519130#M146166</guid>
      <dc:creator>DanK</dc:creator>
      <dc:date>2020-09-11T16:17:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter rows based on a regex match on all fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-filter-rows-based-on-a-regex-match-on-all-fields/m-p/519148#M146176</link>
      <description>&lt;P&gt;I'm not really sure what happened, maybe I needed to refresh after I used&amp;nbsp;&lt;SPAN&gt;&amp;lt;![CDATA[ ..... ]]&amp;gt; or perhaps I had a typo in my implementation of the original foreach alternative. But this is working now.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 11 Sep 2020 18:33:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-filter-rows-based-on-a-regex-match-on-all-fields/m-p/519148#M146176</guid>
      <dc:creator>DanK</dc:creator>
      <dc:date>2020-09-11T18:33:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter rows based on a regex match on all fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-filter-rows-based-on-a-regex-match-on-all-fields/m-p/519194#M146199</link>
      <description>Every time after you change dashboard it’s good to do refresh and some times even restart is mandatory.</description>
      <pubDate>Sat, 12 Sep 2020 07:54:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-filter-rows-based-on-a-regex-match-on-all-fields/m-p/519194#M146199</guid>
      <dc:creator>isoutamo</dc:creator>
      <dc:date>2020-09-12T07:54:17Z</dc:date>
    </item>
  </channel>
</rss>

