<?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: syntax error in subpattern name (missing terminator) in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Regex-syntax-error-in-subpattern-name-missing-terminator/m-p/133065#M36351</link>
    <description>&lt;P&gt;I cannot  give you an example event because it is a large file. But I am extracting the fields correctly because I verified the regular expression in my Search and Reporting App and the table I want to have in my app. &lt;/P&gt;

&lt;P&gt;The field "failed_step" is extracted from the field "test_step" and its values(test_step)  look like this one.&lt;/P&gt;

&lt;P&gt;STEP: 0902 RESULT: PASS ACTUAL: NO DATA READ RETRIES: 1 &lt;/P&gt;

&lt;P&gt;Basically what I am doing it's separating the steps that have failed from the general steps. Also the data format in the steps is unstructured and random. This is the reason why I am extracting everything with [\w\W\n].&lt;/P&gt;

&lt;P&gt;I think the problem it is related with html. I really don't know anything about html and maybe there is some restriction that I am missing.&lt;/P&gt;</description>
    <pubDate>Mon, 28 Sep 2020 20:07:09 GMT</pubDate>
    <dc:creator>edrivera3</dc:creator>
    <dc:date>2020-09-28T20:07:09Z</dc:date>
    <item>
      <title>Regex: syntax error in subpattern name (missing terminator)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-syntax-error-in-subpattern-name-missing-terminator/m-p/133057#M36343</link>
      <description>&lt;P&gt;Hi&lt;BR /&gt;
I encountered the following error message : &lt;/P&gt;

&lt;P&gt;Error Message:&lt;BR /&gt;
 Error in 'rex' command: Encountered the following error while compiling the regex '(?&amp;lt;failed_step&amp;gt;STEP:[&amp;amp;#92w&amp;amp;#92W\n]+?RETRIES:\s{3}\d+)': Regex: syntax error in subpattern name (missing terminator) &lt;/P&gt;

&lt;P&gt;The extraction works correctly in the Search and Reporting App.&lt;/P&gt;

&lt;P&gt;This my html page:&lt;BR /&gt;
&amp;lt;script&amp;gt;&lt;BR /&gt;
    var deps = [&lt;BR /&gt;
        "splunkjs/ready!",&lt;BR /&gt;
    "splunkjs/mvc",&lt;BR /&gt;
    "splunkjs/mvc/utils",&lt;BR /&gt;
        "splunkjs/mvc/searchmanager",&lt;BR /&gt;
        "splunkjs/mvc/chartview",&lt;BR /&gt;
        "splunkjs/mvc/checkboxgroupview",&lt;BR /&gt;
        "splunkjs/mvc/checkboxview",&lt;BR /&gt;
        "splunkjs/mvc/dropdownview",&lt;BR /&gt;
        "splunkjs/mvc/eventsviewerview",&lt;BR /&gt;
        "splunkjs/mvc/multidropdownview",&lt;BR /&gt;
        "splunkjs/mvc/radiogroupview",&lt;BR /&gt;
        "splunkjs/mvc/searchbarview",&lt;BR /&gt;
        "splunkjs/mvc/searchcontrolsview",&lt;BR /&gt;
        "splunkjs/mvc/singleview",&lt;BR /&gt;
        "splunkjs/mvc/tableview",&lt;BR /&gt;
        "splunkjs/mvc/textinputview",&lt;BR /&gt;
        "splunkjs/mvc/timelineview",&lt;BR /&gt;
        "splunkjs/mvc/timerangeview",&lt;BR /&gt;
    "splunkjs/mvc/simplexml",&lt;BR /&gt;
    "splunkjs/mvc/splunkmapview",&lt;BR /&gt;
    "jquery",&lt;BR /&gt;
    "splunk_wftoolkit/components/bubblechart/bubblechart",&lt;BR /&gt;
    "splunk.config",&lt;BR /&gt;
    "underscore"&lt;BR /&gt;
    ];&lt;BR /&gt;
    require(deps, function(mvc) {&lt;BR /&gt;
        // Load individual components&lt;BR /&gt;
        var SearchManager = require("splunkjs/mvc/searchmanager");&lt;BR /&gt;
        var TimelineView = require("splunkjs/mvc/timelineview");&lt;BR /&gt;
        var ChartView = require("splunkjs/mvc/chartview");&lt;BR /&gt;
        var CheckboxGroupView = require("splunkjs/mvc/checkboxgroupview");&lt;BR /&gt;
        var CheckboxView = require("splunkjs/mvc/checkboxview");&lt;BR /&gt;
        var DropdownView = require("splunkjs/mvc/dropdownview");&lt;BR /&gt;
        var EventsViewer = require("splunkjs/mvc/eventsviewerview");&lt;BR /&gt;
        var MultiDropdownView = require("splunkjs/mvc/multidropdownview");&lt;BR /&gt;
        var RadioGroupView = require("splunkjs/mvc/radiogroupview");&lt;BR /&gt;
        var SearchbarView = require("splunkjs/mvc/searchbarview");&lt;BR /&gt;
        var SearchControlsView = require("splunkjs/mvc/searchcontrolsview");&lt;BR /&gt;
        var SingleView = require("splunkjs/mvc/singleview");&lt;BR /&gt;
        var TableView = require("splunkjs/mvc/tableview");&lt;BR /&gt;
        var TextInputView = require("splunkjs/mvc/textinputview");&lt;BR /&gt;
        var TimeRangeView = require("splunkjs/mvc/timerangeview");&lt;BR /&gt;
    var BubbleView = require("splunk_wftoolkit/components/bubblechart/bubblechart");&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;// Table (Top Failed Steps in test containing this error)

var Top_FailStep = new SearchManager({
    id: "Top_FailStep",
    search: mvc.tokenSafe('index=tirfile AND [search index=jobevent earliest=\"-1y\" latest=\"now\" error_num=$error_num$ test_num=$test_num$ | fields test_num,cart_num] | rex field=test_step \"(?&amp;amp;lt;failed_step&amp;amp;gt;STEP:[\\w\\W\\n]+?RETRIES:\\s{3}\\d+)\" '),
        cache: true,
        preview: true
});

var table_Top_FailStep = new TableView({
    id: "table_Top_FailStep",
    managerid: "Top_FailStep",
    el: $("#table_Top_FailStep")
}).render();
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I appreciate your help.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 20:07:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-syntax-error-in-subpattern-name-missing-terminator/m-p/133057#M36343</guid>
      <dc:creator>edrivera3</dc:creator>
      <dc:date>2020-09-28T20:07:04Z</dc:date>
    </item>
    <item>
      <title>Re: Regex: syntax error in subpattern name (missing terminator)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-syntax-error-in-subpattern-name-missing-terminator/m-p/133058#M36344</link>
      <description>&lt;P&gt;Hello&lt;BR /&gt;
Escape double points  &lt;CODE&gt;STEP\:&lt;/CODE&gt;  &lt;CODE&gt;RETRIES\:&lt;/CODE&gt;in your regular expression, and let me know what happen.&lt;BR /&gt;
Thanks &lt;/P&gt;</description>
      <pubDate>Mon, 01 Jun 2015 20:09:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-syntax-error-in-subpattern-name-missing-terminator/m-p/133058#M36344</guid>
      <dc:creator>stephanefotso</dc:creator>
      <dc:date>2015-06-01T20:09:10Z</dc:date>
    </item>
    <item>
      <title>Re: Regex: syntax error in subpattern name (missing terminator)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-syntax-error-in-subpattern-name-missing-terminator/m-p/133059#M36345</link>
      <description>&lt;P&gt;There was no change. I tried singular escape (\) and double escape (\\).&lt;/P&gt;</description>
      <pubDate>Mon, 01 Jun 2015 20:15:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-syntax-error-in-subpattern-name-missing-terminator/m-p/133059#M36345</guid>
      <dc:creator>edrivera3</dc:creator>
      <dc:date>2015-06-01T20:15:29Z</dc:date>
    </item>
    <item>
      <title>Re: Regex: syntax error in subpattern name (missing terminator)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-syntax-error-in-subpattern-name-missing-terminator/m-p/133060#M36346</link>
      <description>&lt;P&gt;Try this &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;search: mvc.tokenSafe("index=tirfile AND [search index=jobevent earliest=\"-1y\" latest=\"now\" error_num=$error_num$ test_num=$test_num$ | fields test_num,cart_num] | rex field=test_step \"(?&amp;amp;lt;failed_step&amp;amp;gt;STEP\:[\\w\\W\\n]+?RETRIES\:\\s{3}\\d+)\" ")   
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 01 Jun 2015 20:48:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-syntax-error-in-subpattern-name-missing-terminator/m-p/133060#M36346</guid>
      <dc:creator>stephanefotso</dc:creator>
      <dc:date>2015-06-01T20:48:36Z</dc:date>
    </item>
    <item>
      <title>Re: Regex: syntax error in subpattern name (missing terminator)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-syntax-error-in-subpattern-name-missing-terminator/m-p/133061#M36347</link>
      <description>&lt;P&gt;There was no change.&lt;/P&gt;</description>
      <pubDate>Mon, 01 Jun 2015 20:55:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-syntax-error-in-subpattern-name-missing-terminator/m-p/133061#M36347</guid>
      <dc:creator>edrivera3</dc:creator>
      <dc:date>2015-06-01T20:55:28Z</dc:date>
    </item>
    <item>
      <title>Re: Regex: syntax error in subpattern name (missing terminator)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-syntax-error-in-subpattern-name-missing-terminator/m-p/133062#M36348</link>
      <description>&lt;P&gt;Wao! ok now try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; search: mvc.tokenSafe("index=tirfile AND [search index=jobevent earliest=\"-1y\" latest=\"now\" error_num=$error_num$ test_num=$test_num$ | fields test_num,cart_num] | rex field=test_step \"(?&amp;amp;lt;failed_step&amp;amp;gt;STEP\:[\w\W\n]+?RETRIES\:\s{3}\d+)\" ") 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;or this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; search: mvc.tokenSafe('index=tirfile AND [search index=jobevent earliest=\"-1y\" latest=\"now\" error_num=$error_num$ test_num=$test_num$ | fields test_num,cart_num] | rex field=test_step \\"(?&amp;amp;lt;failed_step&amp;amp;gt;STEP\:[\\w\\W\\n]+?RETRIES\:\\s{3}\\d+)\\" ') 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 01 Jun 2015 21:22:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-syntax-error-in-subpattern-name-missing-terminator/m-p/133062#M36348</guid>
      <dc:creator>stephanefotso</dc:creator>
      <dc:date>2015-06-01T21:22:17Z</dc:date>
    </item>
    <item>
      <title>Re: Regex: syntax error in subpattern name (missing terminator)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-syntax-error-in-subpattern-name-missing-terminator/m-p/133063#M36349</link>
      <description>&lt;P&gt;There was no change. The app page didn't load with the second one. I am going to update my question to bring more information about my page.&lt;/P&gt;</description>
      <pubDate>Mon, 01 Jun 2015 21:30:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-syntax-error-in-subpattern-name-missing-terminator/m-p/133063#M36349</guid>
      <dc:creator>edrivera3</dc:creator>
      <dc:date>2015-06-01T21:30:44Z</dc:date>
    </item>
    <item>
      <title>Re: Regex: syntax error in subpattern name (missing terminator)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-syntax-error-in-subpattern-name-missing-terminator/m-p/133064#M36350</link>
      <description>&lt;P&gt;Ok. also let me get your sample event where you are extracting &lt;STRONG&gt;failed_step&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 01 Jun 2015 23:05:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-syntax-error-in-subpattern-name-missing-terminator/m-p/133064#M36350</guid>
      <dc:creator>stephanefotso</dc:creator>
      <dc:date>2015-06-01T23:05:23Z</dc:date>
    </item>
    <item>
      <title>Re: Regex: syntax error in subpattern name (missing terminator)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-syntax-error-in-subpattern-name-missing-terminator/m-p/133065#M36351</link>
      <description>&lt;P&gt;I cannot  give you an example event because it is a large file. But I am extracting the fields correctly because I verified the regular expression in my Search and Reporting App and the table I want to have in my app. &lt;/P&gt;

&lt;P&gt;The field "failed_step" is extracted from the field "test_step" and its values(test_step)  look like this one.&lt;/P&gt;

&lt;P&gt;STEP: 0902 RESULT: PASS ACTUAL: NO DATA READ RETRIES: 1 &lt;/P&gt;

&lt;P&gt;Basically what I am doing it's separating the steps that have failed from the general steps. Also the data format in the steps is unstructured and random. This is the reason why I am extracting everything with [\w\W\n].&lt;/P&gt;

&lt;P&gt;I think the problem it is related with html. I really don't know anything about html and maybe there is some restriction that I am missing.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 20:07:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-syntax-error-in-subpattern-name-missing-terminator/m-p/133065#M36351</guid>
      <dc:creator>edrivera3</dc:creator>
      <dc:date>2020-09-28T20:07:09Z</dc:date>
    </item>
    <item>
      <title>Re: Regex: syntax error in subpattern name (missing terminator)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-syntax-error-in-subpattern-name-missing-terminator/m-p/133066#M36352</link>
      <description>&lt;P&gt;The problem is to well escape key words. It would be easier for me if I had one of your events, to make a test myself.&lt;BR /&gt;
Thanks.&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jun 2015 11:59:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-syntax-error-in-subpattern-name-missing-terminator/m-p/133066#M36352</guid>
      <dc:creator>stephanefotso</dc:creator>
      <dc:date>2015-06-03T11:59:28Z</dc:date>
    </item>
    <item>
      <title>Re: Regex: syntax error in subpattern name (missing terminator)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-syntax-error-in-subpattern-name-missing-terminator/m-p/133067#M36353</link>
      <description>&lt;P&gt;First of all, thanks stephanefotso for trying to help.&lt;/P&gt;

&lt;P&gt;I found the solution to my problem. Appears that when you are working with web framework you cannot use the HTML entity to add a &amp;lt; &amp;gt; symbols. The way around this is to simply escape &amp;lt; &amp;gt; symbols. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;    search: mvc.tokenSafe('index=tirfile AND [search index=jobevent  earliest="-1y" latest="now" error_num=$error_num$ test_num=$test_num$ | fields test_num,cart_num] | rex field=test_step "(?\&amp;lt;failed_step\&amp;gt;STEP:[\\w\\W\\n]+RETRIES:\\s{3}\\d+)" max_match=0 '),
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 03 Jun 2015 14:07:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-syntax-error-in-subpattern-name-missing-terminator/m-p/133067#M36353</guid>
      <dc:creator>edrivera3</dc:creator>
      <dc:date>2015-06-03T14:07:16Z</dc:date>
    </item>
  </channel>
</rss>

