<?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: Getting error Error in 'rex' command: Encountered the following error while compiling the regex '\/home\/mysqld\/(?&amp;amp; in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Why-the-error-Error-in-rex-command-while-compiling-the-regex/m-p/626315#M217689</link>
    <description>&lt;P&gt;I am using source editor&lt;/P&gt;</description>
    <pubDate>Sun, 08 Jan 2023 08:55:34 GMT</pubDate>
    <dc:creator>shruti14</dc:creator>
    <dc:date>2023-01-08T08:55:34Z</dc:date>
    <item>
      <title>Why the error Error in 'rex' command while compiling the regex '\/home\/mysqld\/(?&amp;lt;D?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-the-error-Error-in-rex-command-while-compiling-the-regex/m-p/626295#M217681</link>
      <description>&lt;P&gt;index=mysql sourcetype=audit_log earliest=1&lt;BR /&gt;| rex field=source "\/home\/mysqld\/(?&amp;amp;lt;Database1&amp;amp;gt;.*)\/audit\/"&lt;BR /&gt;| rex field=source "\/mydata\/log\/(?&amp;amp;lt;Database2&amp;amp;gt;.*)\/audit\/"&lt;BR /&gt;| eval Database = coalesce(Database1,Database2)&lt;BR /&gt;| fields - Database1,Database2&lt;BR /&gt;| rex field=USER "(?&amp;amp;lt;USER&amp;amp;gt;[^\[]+)"&lt;BR /&gt;| rex mode=sed field=HOST "s/\.[a-z].*$//g"&lt;BR /&gt;| eval TIMESTAMP=strptime(TIMESTAMP, "%Y-%m-%dT%H:%M:%S UTC")&lt;BR /&gt;| where TIMESTAMP &amp;amp;gt; now()-3600*24*90&lt;BR /&gt;| eval TIMESTAMP=strftime(TIMESTAMP, "%Y-%m-%d")&lt;BR /&gt;| eval COMMAND_CLASS=if(isnull(COMMAND_CLASS) OR COMMAND_CLASS="", "NA", COMMAND_CLASS)&lt;BR /&gt;| eval HOST=if(isnull(HOST) OR HOST="", "NA", HOST)&lt;BR /&gt;| eval IP=if(isnull(IP) OR IP="", "NA", IP)&lt;BR /&gt;| eval Action=if(isnull(NAME) OR NAME="", "NA", NAME)&lt;BR /&gt;| eval STATUS=if(isnull(STATUS) OR STATUS="", "NA", STATUS)&lt;BR /&gt;| eval Query=if(isnull(SQLTEXT) OR SQLTEXT="", "NA", SQLTEXT)&lt;BR /&gt;| eval USER=if(isnull(USER) OR USER="", "NA", USER)&lt;BR /&gt;| stats count as Events by Database USER HOST IP COMMAND_CLASS Action STATUS Query TIMESTAMP&lt;BR /&gt;| lookup mysql_databases.csv DATABASE as Database OUTPUT APP_NAME&lt;BR /&gt;| eval APP_NAME=if(isnull(APP_NAME) OR APP_NAME="", "NA", APP_NAME)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;and hence getting no output in search and reporting tab&lt;/P&gt;</description>
      <pubDate>Mon, 09 Jan 2023 16:21:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-the-error-Error-in-rex-command-while-compiling-the-regex/m-p/626295#M217681</guid>
      <dc:creator>shruti14</dc:creator>
      <dc:date>2023-01-09T16:21:55Z</dc:date>
    </item>
    <item>
      <title>Re: Getting error Error in 'rex' command: Encountered the following error while compiling the regex '\/home\/mysqld\/(?&amp;</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-the-error-Error-in-rex-command-while-compiling-the-regex/m-p/626296#M217682</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Error in 'rex' command: Encountered the following error while compiling the regex '\/home\/mysqld\/(?&amp;amp;lt;Database1&amp;amp;gt;.*)\/audit\/': Regex: syntax error in subpattern name (missing terminator).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 07 Jan 2023 14:15:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-the-error-Error-in-rex-command-while-compiling-the-regex/m-p/626296#M217682</guid>
      <dc:creator>shruti14</dc:creator>
      <dc:date>2023-01-07T14:15:18Z</dc:date>
    </item>
    <item>
      <title>Re: Getting error Error in 'rex' command: Encountered the following error while compiling the regex '\/home\/mysqld\/(?&amp;</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-the-error-Error-in-rex-command-while-compiling-the-regex/m-p/626300#M217683</link>
      <description>&lt;P&gt;Are you sure they are not supposed to be this?&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex field=source "\/home\/mysqld\/(?&amp;lt;Database1&amp;gt;.*)\/audit\/"
| rex field=source "\/mydata\/log\/(?&amp;lt;Database2&amp;gt;.*)\/audit\/"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;You use HTML entities in dashboard source (if dashboard is SimpleXML), but not in search line.&lt;/P&gt;</description>
      <pubDate>Sat, 07 Jan 2023 18:23:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-the-error-Error-in-rex-command-while-compiling-the-regex/m-p/626300#M217683</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2023-01-07T18:23:17Z</dc:date>
    </item>
    <item>
      <title>Re: Getting error Error in 'rex' command: Encountered the following error while compiling the regex '\/home\/mysqld\/(?&amp;</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-the-error-Error-in-rex-command-while-compiling-the-regex/m-p/626301#M217684</link>
      <description>&lt;P&gt;Dashboard is simple xml but there also&amp;nbsp;&lt;SPAN&gt;| rex field=source "\/home\/mysqld\/(?&amp;amp;lt;Database1&amp;amp;gt;.*)\/audit\/"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;| rex field=source "\/mydata\/log\/(?&amp;amp;lt;Database2&amp;amp;gt;.*)\/audit\/" not giving me result.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 07 Jan 2023 18:52:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-the-error-Error-in-rex-command-while-compiling-the-regex/m-p/626301#M217684</guid>
      <dc:creator>shruti14</dc:creator>
      <dc:date>2023-01-07T18:52:58Z</dc:date>
    </item>
    <item>
      <title>Re: Getting error Error in 'rex' command: Encountered the following error while compiling the regex '\/home\/mysqld\/(?&amp;</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-the-error-Error-in-rex-command-while-compiling-the-regex/m-p/626307#M217685</link>
      <description>&lt;P&gt;The question is in which interface do you see "&lt;SPAN&gt;&lt;FONT face="andale mono,times"&gt;(?&amp;amp;lt;Database1&amp;amp;gt;.*)&lt;/FONT&gt;". &amp;nbsp;If you see them in the source editor, they should not cause any problem at all. &amp;nbsp;If you see them in panel editor, or worse, if you enter them into the search bar, they are plain wrong.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;In case you are unfamiliar with Splunk's editor interfaces, whether you are using source editor or panel editor is determined by how you start the editing. &amp;nbsp;Here are some screenshots to show their differences.&lt;/P&gt;&lt;P&gt;This is the source editor&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="source-editor.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/23251i6B5FE1A9CEC7075F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="source-editor.png" alt="source-editor.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;This is the panel search editor&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="panel-editor.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/23252iA38F64F21D4FE5D6/image-size/medium?v=v2&amp;amp;px=400" role="button" title="panel-editor.png" alt="panel-editor.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;(Of course you know how the search bar look like.)&lt;/P&gt;&lt;P&gt;This is another interface that allows you to select which editor to use from the dashboard list.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="editor-choice.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/23253i7604BEE0B2BCCC5C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="editor-choice.png" alt="editor-choice.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Hope this&amp;nbsp; helps.&lt;/P&gt;</description>
      <pubDate>Sat, 07 Jan 2023 21:49:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-the-error-Error-in-rex-command-while-compiling-the-regex/m-p/626307#M217685</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2023-01-07T21:49:15Z</dc:date>
    </item>
    <item>
      <title>Re: Getting error Error in 'rex' command: Encountered the following error while compiling the regex '\/home\/mysqld\/(?&amp;</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-the-error-Error-in-rex-command-while-compiling-the-regex/m-p/626315#M217689</link>
      <description>&lt;P&gt;I am using source editor&lt;/P&gt;</description>
      <pubDate>Sun, 08 Jan 2023 08:55:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-the-error-Error-in-rex-command-while-compiling-the-regex/m-p/626315#M217689</guid>
      <dc:creator>shruti14</dc:creator>
      <dc:date>2023-01-08T08:55:34Z</dc:date>
    </item>
    <item>
      <title>Re: Getting error Error in 'rex' command: Encountered the following error while compiling the regex '\/home\/mysqld\/(?&amp;</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-the-error-Error-in-rex-command-while-compiling-the-regex/m-p/626317#M217690</link>
      <description>&lt;P&gt;If you did copy from source editor, the search view (in panel editor) of the two lines should be as I printed above, i.e.,&lt;/P&gt;&lt;PRE&gt;| rex field=source "\/home\/mysqld\/(?&amp;lt;Database1&amp;gt;.*)\/audit\/"
| rex field=source "\/mydata\/log\/(?&amp;lt;Database2&amp;gt;.*)\/audit\/"&lt;/PRE&gt;&lt;P&gt;These two lines are correct and do not cause the error in your question. &amp;nbsp;Can you show us the actual search code in search view (under panel editor)?&lt;/P&gt;&lt;P&gt;Or are you trying to copy from source editor into a search window? &amp;nbsp;Generally that will cause error if there are any characters &amp;nbsp;that needs to be presented as HTML entities in Simple XML, such as less-than sign (&amp;lt;) and greater-than sign (&amp;gt;) as is used in rex commands. &amp;nbsp;Simply put, do not copy code from source editor into search window. &amp;nbsp;If you need to copy something into search window, you must use the panel editor. (Or, outside of editor, use "Open in search" link (magnifying glass).)&lt;/P&gt;</description>
      <pubDate>Sun, 08 Jan 2023 09:36:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-the-error-Error-in-rex-command-while-compiling-the-regex/m-p/626317#M217690</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2023-01-08T09:36:49Z</dc:date>
    </item>
  </channel>
</rss>

