<?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: Regex command causing the search to not work - unknown search command in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Regex-command-causing-the-search-to-not-work-unknown-search/m-p/487454#M136225</link>
    <description>&lt;P&gt;Hi  ssjabid,&lt;BR /&gt;
did you tried with quotes in rex command?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rex "REQ\=\".*\/(?&amp;lt;page&amp;gt;\w*[^0-9]+(\.jsp)?)\/?\""
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Optiion field=_raw isn't important.&lt;/P&gt;

&lt;P&gt;Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
    <pubDate>Wed, 18 Sep 2019 12:19:34 GMT</pubDate>
    <dc:creator>gcusello</dc:creator>
    <dc:date>2019-09-18T12:19:34Z</dc:date>
    <item>
      <title>Regex command causing the search to not work - unknown search command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-command-causing-the-search-to-not-work-unknown-search/m-p/487451#M136222</link>
      <description>&lt;P&gt;Hi People,&lt;/P&gt;

&lt;P&gt;I am trying to run a regex command to cut out a part of the REQ field, &lt;BR /&gt;
On regex 101 it is working fine, however on Splunk it is causing problems and i get an unknown search command error&lt;/P&gt;

&lt;P&gt;Here is the query i am using, &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=was_unauth sourcetype=ibm:was:jmx ReqMethod="POST" 
NOT [| inputlookup policy_wlist_ipaddr_digital_ | fields src]
| rename DIP as src, SIP as src CUST as username USR as username
| rex field=_raw REQ\=\".*\/(?&amp;lt;page&amp;gt;\w*[^0-9]+(\.jsp)?)\/?\"
| search src!="10.0.0.0/8" src!="141.92.0.0/16" NOT username=* page!="phoneauthentication" AND page!="1*"
| stats count by page
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I do not want the regex command to cut out pages with numbers in them, so i've included [^0-9] in there which works on regex 101 but Splunk does not like it, even when i use a backslash to block it out but it still doesn't pull out the data, &lt;/P&gt;

&lt;P&gt;I've also tried using &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=was_unauth sourcetype=ibm:was:jmx ReqMethod="POST" 
NOT [| inputlookup policy_wlist_ipaddr_digital_ | fields src]
| rename DIP as src, SIP as src CUST as username USR as username
| rex field=_raw REQ\=\".*\/(?&amp;lt;page&amp;gt;[a-zA-Z_]+(\.jsp)?)\/?\"
| search src!="10.0.0.0/8" src!="141.92.0.0/16" NOT username=* page!="phoneauthentication" AND page!="1*"
| stats count by page
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;but this gives me the unknown search command :a error &lt;/P&gt;

&lt;P&gt;Any help would be greatly appreciated,&lt;BR /&gt;
Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 18 Sep 2019 11:22:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-command-causing-the-search-to-not-work-unknown-search/m-p/487451#M136222</guid>
      <dc:creator>ssjabid</dc:creator>
      <dc:date>2019-09-18T11:22:10Z</dc:date>
    </item>
    <item>
      <title>Re: Regex command causing the search to not work - unknown search command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-command-causing-the-search-to-not-work-unknown-search/m-p/487452#M136223</link>
      <description>&lt;P&gt;@ssjabid &lt;/P&gt;

&lt;P&gt;Can you please share sample data???&lt;/P&gt;</description>
      <pubDate>Wed, 18 Sep 2019 11:42:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-command-causing-the-search-to-not-work-unknown-search/m-p/487452#M136223</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2019-09-18T11:42:33Z</dc:date>
    </item>
    <item>
      <title>Re: Regex command causing the search to not work - unknown search command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-command-causing-the-search-to-not-work-unknown-search/m-p/487453#M136224</link>
      <description>&lt;P&gt;REQ="././././switches" EVC="EVT_TRACE" EID="securityfilter.request" DIP="&lt;EM&gt;" CLS="&lt;/EM&gt;" 4ReqURI="/&lt;EM&gt;/&lt;/EM&gt;/*/api/v1/switches"&lt;/P&gt;

&lt;P&gt;so i am trying to capture the switches part in REQ however sometimes when a log appears with a number would appear instead, i would like to ignore that, but [^0-9] doesn't happen to work&lt;/P&gt;</description>
      <pubDate>Wed, 18 Sep 2019 11:47:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-command-causing-the-search-to-not-work-unknown-search/m-p/487453#M136224</guid>
      <dc:creator>ssjabid</dc:creator>
      <dc:date>2019-09-18T11:47:32Z</dc:date>
    </item>
    <item>
      <title>Re: Regex command causing the search to not work - unknown search command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-command-causing-the-search-to-not-work-unknown-search/m-p/487454#M136225</link>
      <description>&lt;P&gt;Hi  ssjabid,&lt;BR /&gt;
did you tried with quotes in rex command?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rex "REQ\=\".*\/(?&amp;lt;page&amp;gt;\w*[^0-9]+(\.jsp)?)\/?\""
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Optiion field=_raw isn't important.&lt;/P&gt;

&lt;P&gt;Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Wed, 18 Sep 2019 12:19:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-command-causing-the-search-to-not-work-unknown-search/m-p/487454#M136225</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2019-09-18T12:19:34Z</dc:date>
    </item>
    <item>
      <title>Re: Regex command causing the search to not work - unknown search command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-command-causing-the-search-to-not-work-unknown-search/m-p/487455#M136226</link>
      <description>&lt;P&gt;The rex command requires quotation marks around the regex expression.&lt;BR /&gt;
&lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Rex#Required_arguments"&gt;https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Rex#Required_arguments&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Sep 2019 12:47:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-command-causing-the-search-to-not-work-unknown-search/m-p/487455#M136226</guid>
      <dc:creator>janispelss</dc:creator>
      <dc:date>2019-09-18T12:47:21Z</dc:date>
    </item>
    <item>
      <title>Re: Regex command causing the search to not work - unknown search command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-command-causing-the-search-to-not-work-unknown-search/m-p/487456#M136227</link>
      <description>&lt;P&gt;Managed to get it working &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; this did help! thank you!&lt;/P&gt;</description>
      <pubDate>Wed, 18 Sep 2019 15:01:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-command-causing-the-search-to-not-work-unknown-search/m-p/487456#M136227</guid>
      <dc:creator>ssjabid</dc:creator>
      <dc:date>2019-09-18T15:01:15Z</dc:date>
    </item>
  </channel>
</rss>

