<?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: Multiple rex commands no longer works in Fast/Smart mode? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Multiple-rex-commands-no-longer-works-in-Fast-Smart-mode/m-p/351186#M103963</link>
    <description>&lt;P&gt;A later failed-to-match &lt;CODE&gt;rex&lt;/CODE&gt; has never overwritten an earlier succeeded-to-mach &lt;CODE&gt;rex&lt;/CODE&gt;, in my experience.  Perhaps this is what he means (that a later null-match is clearing an earlier match).&lt;/P&gt;</description>
    <pubDate>Mon, 12 Jun 2017 23:10:41 GMT</pubDate>
    <dc:creator>woodcock</dc:creator>
    <dc:date>2017-06-12T23:10:41Z</dc:date>
    <item>
      <title>Multiple rex commands no longer works in Fast/Smart mode?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Multiple-rex-commands-no-longer-works-in-Fast-Smart-mode/m-p/351177#M103954</link>
      <description>&lt;P&gt;In Splunk 6.6.1, it seems like multiple rex commands with the same field name does no longer work in Fast or Smart mode, if it's followed by for example stats or table.&lt;/P&gt;

&lt;P&gt;I want to rex the words "please", "extract" and "me":&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=test please_extract_me
| rex "(?&amp;lt;my_field&amp;gt;.*)_extract_me"
| rex "please_(?&amp;lt;my_field&amp;gt;.*)_me"
| rex "please_extract_(?&amp;lt;my_field&amp;gt;.*)"
| stats count by my_field
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Usually, regardless of what search mode was used, I would/should get three lines as result. Now I have to select Verbose mode to get it to work; in Fast or Smart mode, only the last rex works and will show up in the count.&lt;/P&gt;

&lt;P&gt;One way around this is apparently by doing this, as if the different rex's would create multiple fields with the same name instead of one field with multiple values:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=test please_extract_me
| rex "(?&amp;lt;my_field&amp;gt;.*)_extract_me"
| rex "please_(?&amp;lt;my_field&amp;gt;.*)_me"
| rex "please_extract_(?&amp;lt;my_field&amp;gt;.*)"
| fields *
| stats count by my_field
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Anyone else experiencing this?&lt;/P&gt;</description>
      <pubDate>Mon, 12 Jun 2017 14:31:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Multiple-rex-commands-no-longer-works-in-Fast-Smart-mode/m-p/351177#M103954</guid>
      <dc:creator>mattiaslindblom</dc:creator>
      <dc:date>2017-06-12T14:31:43Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple rex commands no longer works in Fast/Smart mode?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Multiple-rex-commands-no-longer-works-in-Fast-Smart-mode/m-p/351178#M103955</link>
      <description>&lt;P&gt;Add the &lt;CODE&gt;bug&lt;/CODE&gt; tag and open a support case.  Also go to the documentation page for the release notes and leave a comment there that a note should be added.&lt;/P&gt;</description>
      <pubDate>Mon, 12 Jun 2017 15:23:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Multiple-rex-commands-no-longer-works-in-Fast-Smart-mode/m-p/351178#M103955</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-06-12T15:23:13Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple rex commands no longer works in Fast/Smart mode?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Multiple-rex-commands-no-longer-works-in-Fast-Smart-mode/m-p/351179#M103956</link>
      <description>&lt;P&gt;You're using the same field name in all your rex commands, so every rex command is overwriting the value from previous rex command hence you would see value &lt;CODE&gt;me&lt;/CODE&gt; that was extracted from last regex. That's how rex behaves regardless of Search mode selected (as seen in Splunk 6.2, 6.3). Do you really get multiple field values from your query when you run the search in Verbose mode? &lt;/P&gt;</description>
      <pubDate>Mon, 12 Jun 2017 17:30:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Multiple-rex-commands-no-longer-works-in-Fast-Smart-mode/m-p/351179#M103956</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-06-12T17:30:39Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple rex commands no longer works in Fast/Smart mode?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Multiple-rex-commands-no-longer-works-in-Fast-Smart-mode/m-p/351180#M103957</link>
      <description>&lt;P&gt;My comment is only valid assuming that you are entirely correct about the change in behavior, which may not be the case.&lt;/P&gt;</description>
      <pubDate>Mon, 12 Jun 2017 17:43:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Multiple-rex-commands-no-longer-works-in-Fast-Smart-mode/m-p/351180#M103957</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-06-12T17:43:57Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple rex commands no longer works in Fast/Smart mode?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Multiple-rex-commands-no-longer-works-in-Fast-Smart-mode/m-p/351181#M103958</link>
      <description>&lt;P&gt;Yes, Verbose mode works fine, and I've been using this in a dashboard that now suddenly has stopped working. &lt;/P&gt;</description>
      <pubDate>Mon, 12 Jun 2017 20:12:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Multiple-rex-commands-no-longer-works-in-Fast-Smart-mode/m-p/351181#M103958</guid>
      <dc:creator>mattiaslindblom</dc:creator>
      <dc:date>2017-06-12T20:12:41Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple rex commands no longer works in Fast/Smart mode?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Multiple-rex-commands-no-longer-works-in-Fast-Smart-mode/m-p/351182#M103959</link>
      <description>&lt;P&gt;That's not my understanding of how it ever worked... so if it DOES work in verbose mode, that is probably a bug in verbose mode.  Each rex should overwrite the field... I have rexes in production that assume this, and that are working as designed. &lt;/P&gt;</description>
      <pubDate>Mon, 12 Jun 2017 20:46:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Multiple-rex-commands-no-longer-works-in-Fast-Smart-mode/m-p/351182#M103959</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2017-06-12T20:46:35Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple rex commands no longer works in Fast/Smart mode?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Multiple-rex-commands-no-longer-works-in-Fast-Smart-mode/m-p/351183#M103960</link>
      <description>&lt;P&gt;That is really strange. Would you be able to share a screenshot with results of query in verbose mode something like this?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=test please_extract_me| head 2
 | rex "(?&amp;lt;my_field&amp;gt;.*)_extract_me"
 | rex "please_(?&amp;lt;my_field&amp;gt;.*)_me"
 | rex "please_extract_(?&amp;lt;my_field&amp;gt;.*)"
 | table my_field
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;AFAIK, The dashboards queries are run in fast mode, so wonder it ever worked.&lt;/P&gt;</description>
      <pubDate>Mon, 12 Jun 2017 20:58:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Multiple-rex-commands-no-longer-works-in-Fast-Smart-mode/m-p/351183#M103960</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-06-12T20:58:33Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple rex commands no longer works in Fast/Smart mode?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Multiple-rex-commands-no-longer-works-in-Fast-Smart-mode/m-p/351184#M103961</link>
      <description>&lt;P&gt;Did you try use one ony rex command?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;...
| rex field=_raw "(?P&amp;lt;field1&amp;gt;[^_])_(?P&amp;lt;field2&amp;gt;[^_])_(?P&amp;lt;field3&amp;gt;.*)"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 12 Jun 2017 21:17:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Multiple-rex-commands-no-longer-works-in-Fast-Smart-mode/m-p/351184#M103961</guid>
      <dc:creator>renatobamorim</dc:creator>
      <dc:date>2017-06-12T21:17:24Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple rex commands no longer works in Fast/Smart mode?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Multiple-rex-commands-no-longer-works-in-Fast-Smart-mode/m-p/351185#M103962</link>
      <description>&lt;P&gt;But I know for a fact that it has actually worked before, since I've built functioning dashboards around this behavior, that now don't work any longer. &lt;/P&gt;

&lt;P&gt;And again, adding &lt;CODE&gt;fields *&lt;/CODE&gt; after the multiple rex commands makes it work, which to me doesn't make sense. &lt;/P&gt;</description>
      <pubDate>Mon, 12 Jun 2017 21:17:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Multiple-rex-commands-no-longer-works-in-Fast-Smart-mode/m-p/351185#M103962</guid>
      <dc:creator>mattiaslindblom</dc:creator>
      <dc:date>2017-06-12T21:17:57Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple rex commands no longer works in Fast/Smart mode?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Multiple-rex-commands-no-longer-works-in-Fast-Smart-mode/m-p/351186#M103963</link>
      <description>&lt;P&gt;A later failed-to-match &lt;CODE&gt;rex&lt;/CODE&gt; has never overwritten an earlier succeeded-to-mach &lt;CODE&gt;rex&lt;/CODE&gt;, in my experience.  Perhaps this is what he means (that a later null-match is clearing an earlier match).&lt;/P&gt;</description>
      <pubDate>Mon, 12 Jun 2017 23:10:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Multiple-rex-commands-no-longer-works-in-Fast-Smart-mode/m-p/351186#M103963</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-06-12T23:10:41Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple rex commands no longer works in Fast/Smart mode?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Multiple-rex-commands-no-longer-works-in-Fast-Smart-mode/m-p/351187#M103964</link>
      <description>&lt;P&gt;I agree with all the previous comments, this should not have worked this way. &lt;BR /&gt;
The only thing I can think of is, that since you're using a string in your base search there were other strings in the events which happen to match the regex as well. &lt;/P&gt;

&lt;P&gt;This run everywhere (smart mode) search returns three times the same value &lt;CODE&gt;my_field=me&lt;/CODE&gt;:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; | gentimes start=-1 
 | eval foo="please_extract_me please_extract_me please_extract_me" 
 | makemv foo 
 | mvexpand foo 
 | rex field=foo "(?&amp;lt;my_field&amp;gt;.*)_extract_me" 
 | rex field=foo "please_(?&amp;lt;my_field&amp;gt;.*)_me" 
 | rex field=foo "please_extract_(?&amp;lt;my_field&amp;gt;.*)"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;where as this search returns four different values for &lt;CODE&gt;my_field&lt;/CODE&gt; and would match your base search because it has &lt;CODE&gt;please_extract_me&lt;/CODE&gt;:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| gentimes start=-1 
| eval foo="please_extract_me one_extract_me please_two_me please_extract_three" 
| makemv foo 
| mvexpand foo 
| rex field=foo "(?&amp;lt;my_field&amp;gt;.*)_extract_me" 
| rex field=foo "please_(?&amp;lt;my_field&amp;gt;.*)_me" 
| rex field=foo "please_extract_(?&amp;lt;my_field&amp;gt;.*)"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This is just to explain what I meant. I would suggest to add some raw sample events and your real world dashboard search, this way we all can be of more help. Also, are there any calculated fields or lookups happening for the events you get back from the base search?&lt;/P&gt;

&lt;P&gt;cheers, MuS&lt;/P&gt;</description>
      <pubDate>Tue, 13 Jun 2017 02:31:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Multiple-rex-commands-no-longer-works-in-Fast-Smart-mode/m-p/351187#M103964</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2017-06-13T02:31:20Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple rex commands no longer works in Fast/Smart mode?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Multiple-rex-commands-no-longer-works-in-Fast-Smart-mode/m-p/351188#M103965</link>
      <description>&lt;P&gt;Just so the OP doesn't think he's going crazy, I hit this same bug as well after today's upgrade (v6.6.1). Everything works OK when running in Verbose mode which is (to my knowledge) not an option for dashboard panels.&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;EDIT&lt;/STRONG&gt;: I see the workaround I found has already been posted in the comment thread, but I'm repeating it here as an "Answer" for the public's sake.&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;To workaround this issue, add&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| fields *
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;at the end of the search. I made it the final command before the table and everything works OK now.&lt;/P&gt;</description>
      <pubDate>Tue, 13 Jun 2017 03:30:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Multiple-rex-commands-no-longer-works-in-Fast-Smart-mode/m-p/351188#M103965</guid>
      <dc:creator>RMartinezDTV</dc:creator>
      <dc:date>2017-06-13T03:30:06Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple rex commands no longer works in Fast/Smart mode?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Multiple-rex-commands-no-longer-works-in-Fast-Smart-mode/m-p/351189#M103966</link>
      <description>&lt;P&gt;Some good discussion here. I hit the exact same issue, however, using the max_match= function of the rex command as opposed to having separate rex commands.&lt;/P&gt;

&lt;P&gt;I can understand and agree with the points above when using multiple rex (the field gets overwritten), but I am seeing with same behavior using only a single rex command and the provided "max_match" parameter. That's making me lean closer towards a regression bug as opposed to "previously broken" behavior.&lt;/P&gt;</description>
      <pubDate>Tue, 13 Jun 2017 03:36:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Multiple-rex-commands-no-longer-works-in-Fast-Smart-mode/m-p/351189#M103966</guid>
      <dc:creator>RMartinezDTV</dc:creator>
      <dc:date>2017-06-13T03:36:15Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple rex commands no longer works in Fast/Smart mode?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Multiple-rex-commands-no-longer-works-in-Fast-Smart-mode/m-p/351190#M103967</link>
      <description>&lt;P&gt;Thanks for at least validating my findings.&lt;/P&gt;</description>
      <pubDate>Tue, 13 Jun 2017 08:02:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Multiple-rex-commands-no-longer-works-in-Fast-Smart-mode/m-p/351190#M103967</guid>
      <dc:creator>mattiaslindblom</dc:creator>
      <dc:date>2017-06-13T08:02:43Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple rex commands no longer works in Fast/Smart mode?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Multiple-rex-commands-no-longer-works-in-Fast-Smart-mode/m-p/351191#M103968</link>
      <description>&lt;P&gt;That would create three different fields, though, and I need one field with different values. And for searches where there are different events that you want to rex parts from to the same fields, a one-liner just wouldn't work.&lt;/P&gt;</description>
      <pubDate>Tue, 13 Jun 2017 08:14:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Multiple-rex-commands-no-longer-works-in-Fast-Smart-mode/m-p/351191#M103968</guid>
      <dc:creator>mattiaslindblom</dc:creator>
      <dc:date>2017-06-13T08:14:40Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple rex commands no longer works in Fast/Smart mode?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Multiple-rex-commands-no-longer-works-in-Fast-Smart-mode/m-p/351192#M103969</link>
      <description>&lt;P&gt;The max_match option creates multivalue fields, though, which it should according to the manual. So the behavior you are describing is expected. But this behavior now also seems to apply to multi-line rex. Actually, I just found that adding a &lt;CODE&gt;| mvexpand field_name&lt;/CODE&gt; after the rex commands solves my problem.&lt;/P&gt;

&lt;P&gt;Maybe this was always the intended behavior (even though it obviously hasn't been), but I still find it odd that there's a difference between the search modes.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 14:26:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Multiple-rex-commands-no-longer-works-in-Fast-Smart-mode/m-p/351192#M103969</guid>
      <dc:creator>mattiaslindblom</dc:creator>
      <dc:date>2020-09-29T14:26:35Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple rex commands no longer works in Fast/Smart mode?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Multiple-rex-commands-no-longer-works-in-Fast-Smart-mode/m-p/351193#M103970</link>
      <description>&lt;P&gt;Has an issue/case already raised for this bug in v6.6.1?&lt;BR /&gt;
The issue is prominent in dashboards, as Verbose mode is not an option for dashboard panels.&lt;/P&gt;</description>
      <pubDate>Tue, 31 Oct 2017 07:06:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Multiple-rex-commands-no-longer-works-in-Fast-Smart-mode/m-p/351193#M103970</guid>
      <dc:creator>Shephali</dc:creator>
      <dc:date>2017-10-31T07:06:01Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple rex commands no longer works in Fast/Smart mode?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Multiple-rex-commands-no-longer-works-in-Fast-Smart-mode/m-p/351194#M103971</link>
      <description>&lt;P&gt;Hit this same issue in 7.0, all search modes, workaround did not work either. &lt;/P&gt;</description>
      <pubDate>Tue, 07 Nov 2017 13:23:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Multiple-rex-commands-no-longer-works-in-Fast-Smart-mode/m-p/351194#M103971</guid>
      <dc:creator>drodman29</dc:creator>
      <dc:date>2017-11-07T13:23:02Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple rex commands no longer works in Fast/Smart mode?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Multiple-rex-commands-no-longer-works-in-Fast-Smart-mode/m-p/351195#M103972</link>
      <description>&lt;P&gt;Support is stating that there is a fix in the works for this with a release soon. &lt;BR /&gt;
Until then, there are two possible options&lt;BR /&gt;
1) Do not have more than 1 REX for the same field in your search, extract unique field names and then eval a new name at the end along this design pattern: | eval My_Field=if(isnull(my_field1),my_field2, myfield1) &lt;/P&gt;

&lt;P&gt;2) The second is a work around to turn off optimizations by placing this at the end of your SPL &lt;BR /&gt;
| noop search_optimization=f&lt;/P&gt;

&lt;P&gt;Both of these options are working in my 7.0 install. &lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 16:39:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Multiple-rex-commands-no-longer-works-in-Fast-Smart-mode/m-p/351195#M103972</guid>
      <dc:creator>drodman29</dc:creator>
      <dc:date>2020-09-29T16:39:41Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple rex commands no longer works in Fast/Smart mode?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Multiple-rex-commands-no-longer-works-in-Fast-Smart-mode/m-p/351196#M103973</link>
      <description>&lt;P&gt;Do you happen to know the Issue Number? I didn't see anything relevant under KnownIssues for the versions where I'm experiencing this.&lt;/P&gt;</description>
      <pubDate>Fri, 16 Nov 2018 16:05:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Multiple-rex-commands-no-longer-works-in-Fast-Smart-mode/m-p/351196#M103973</guid>
      <dc:creator>mschaaf</dc:creator>
      <dc:date>2018-11-16T16:05:27Z</dc:date>
    </item>
  </channel>
</rss>

