<?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: Is there a way to force rex to be evaluated before mv functions? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Is-there-a-way-to-force-rex-to-be-evaluated-before-mv-functions/m-p/174384#M50032</link>
    <description>&lt;P&gt;Does the raw data contains ids field enclosed within &lt;CODE&gt;\"&lt;/CODE&gt; or just &lt;CODE&gt;"&lt;/CODE&gt;?&lt;/P&gt;</description>
    <pubDate>Thu, 23 Oct 2014 19:01:36 GMT</pubDate>
    <dc:creator>somesoni2</dc:creator>
    <dc:date>2014-10-23T19:01:36Z</dc:date>
    <item>
      <title>Is there a way to force rex to be evaluated before mv functions?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-there-a-way-to-force-rex-to-be-evaluated-before-mv-functions/m-p/174383#M50031</link>
      <description>&lt;P&gt;I am having a problem extracting multivalued fields. I think it's because this particular field is quoted.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;ids=\"XXX-404994280,XXX-404993710,XXX-335205060,XXX-404991340,XXX-335203510\"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The following search: index=app_logs  env=prod |  makemv delim="," ids | mvexpand ids&lt;/P&gt;

&lt;P&gt;Does not yield the expected results of 5 new events. &lt;/P&gt;

&lt;P&gt;It seems like this is a bug in the way Splunk evaluates multi valued fields that is agitated by the slash and the quote so I was trying to get around this problem by removing the &lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;\"&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;It seems like Splunk must run the rex commands after the mv commands. Is there any way to force it to run rex first? Is there any documentation on the order of operations of the splunk commands?&lt;/P&gt;</description>
      <pubDate>Thu, 23 Oct 2014 18:51:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-there-a-way-to-force-rex-to-be-evaluated-before-mv-functions/m-p/174383#M50031</guid>
      <dc:creator>narduk</dc:creator>
      <dc:date>2014-10-23T18:51:34Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to force rex to be evaluated before mv functions?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-there-a-way-to-force-rex-to-be-evaluated-before-mv-functions/m-p/174384#M50032</link>
      <description>&lt;P&gt;Does the raw data contains ids field enclosed within &lt;CODE&gt;\"&lt;/CODE&gt; or just &lt;CODE&gt;"&lt;/CODE&gt;?&lt;/P&gt;</description>
      <pubDate>Thu, 23 Oct 2014 19:01:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-there-a-way-to-force-rex-to-be-evaluated-before-mv-functions/m-p/174384#M50032</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2014-10-23T19:01:36Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to force rex to be evaluated before mv functions?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-there-a-way-to-force-rex-to-be-evaluated-before-mv-functions/m-p/174385#M50033</link>
      <description>&lt;P&gt;The raw data contains the &lt;CODE&gt;\"&lt;/CODE&gt;. I'll edit the question to reflect that. I see what you did there. &lt;/P&gt;</description>
      <pubDate>Thu, 23 Oct 2014 19:03:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-there-a-way-to-force-rex-to-be-evaluated-before-mv-functions/m-p/174385#M50033</guid>
      <dc:creator>narduk</dc:creator>
      <dc:date>2014-10-23T19:03:22Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to force rex to be evaluated before mv functions?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-there-a-way-to-force-rex-to-be-evaluated-before-mv-functions/m-p/174386#M50034</link>
      <description>&lt;P&gt;Maybe I misunderstand your question, but you mention &lt;CODE&gt;rex&lt;/CODE&gt; commands not running at the point in the search pipeline you want them to... I see no &lt;CODE&gt;rex&lt;/CODE&gt; command in your search?&lt;/P&gt;</description>
      <pubDate>Thu, 23 Oct 2014 22:43:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-there-a-way-to-force-rex-to-be-evaluated-before-mv-functions/m-p/174386#M50034</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2014-10-23T22:43:48Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to force rex to be evaluated before mv functions?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-there-a-way-to-force-rex-to-be-evaluated-before-mv-functions/m-p/174387#M50035</link>
      <description>&lt;P&gt;Ok, so here's the search:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;index=app_logs env=poi-prod rapIds | rex field=_raw mode=sed "s/\\\\\"//g" | makemv delim="," ids   | mvexpand ids&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;and the pertinent piece of the event that I hope to separate into 5 events.&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;ids=\"XXX-404994280,XXX-404993710,XXX-335205060,XXX-404991340,XXX-335203510\"&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Oct 2014 23:56:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-there-a-way-to-force-rex-to-be-evaluated-before-mv-functions/m-p/174387#M50035</guid>
      <dc:creator>narduk</dc:creator>
      <dc:date>2014-10-23T23:56:44Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to force rex to be evaluated before mv functions?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-there-a-way-to-force-rex-to-be-evaluated-before-mv-functions/m-p/174388#M50036</link>
      <description>&lt;P&gt;The problem is that you are using rex to modify the text of the event, _raw, but then your makemv is targetting the field ids.  If you want rex to have an effect upon the makemv, you will need to use it to modify the ids field instead.&lt;/P&gt;</description>
      <pubDate>Fri, 24 Oct 2014 05:02:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-there-a-way-to-force-rex-to-be-evaluated-before-mv-functions/m-p/174388#M50036</guid>
      <dc:creator>jrodman</dc:creator>
      <dc:date>2014-10-24T05:02:36Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to force rex to be evaluated before mv functions?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-there-a-way-to-force-rex-to-be-evaluated-before-mv-functions/m-p/174389#M50037</link>
      <description>&lt;P&gt;Indeed, for example like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | rex field=ids mode=sed "s/\\\\"//g" | makemv ...
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 24 Oct 2014 13:17:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-there-a-way-to-force-rex-to-be-evaluated-before-mv-functions/m-p/174389#M50037</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2014-10-24T13:17:12Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to force rex to be evaluated before mv functions?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-there-a-way-to-force-rex-to-be-evaluated-before-mv-functions/m-p/174390#M50038</link>
      <description>&lt;P&gt;Here's the problem. The field ids, when I look at it in the field viewer is this: &lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;\&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;So the problem is that Splunk terminates the field at the &lt;CODE&gt;\&lt;/CODE&gt; instead of continuing on until the space. I think my thought process here is, if I can remove the troubled &lt;CODE&gt;\ "&lt;/CODE&gt; characters and get Splunk to reevaluate the field, I would be ok.&lt;/P&gt;

&lt;P&gt;Ideas?&lt;/P&gt;</description>
      <pubDate>Fri, 24 Oct 2014 14:29:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-there-a-way-to-force-rex-to-be-evaluated-before-mv-functions/m-p/174390#M50038</guid>
      <dc:creator>narduk</dc:creator>
      <dc:date>2014-10-24T14:29:13Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to force rex to be evaluated before mv functions?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-there-a-way-to-force-rex-to-be-evaluated-before-mv-functions/m-p/174391#M50039</link>
      <description>&lt;P&gt;Actually the best solution is to write your own field extraction that is aware of the backslashes instead of trying to nudge a failing key-value extraction back to life.&lt;/P&gt;

&lt;P&gt;Something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;\bids=\\?"?(?&amp;lt;my_ids&amp;gt;[^\\"]+)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 24 Oct 2014 18:11:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-there-a-way-to-force-rex-to-be-evaluated-before-mv-functions/m-p/174391#M50039</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2014-10-24T18:11:59Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to force rex to be evaluated before mv functions?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-there-a-way-to-force-rex-to-be-evaluated-before-mv-functions/m-p/174392#M50040</link>
      <description>&lt;P&gt;Nailed it. Excellent work around. I created a new field: aaIds. Prefixing my created fields with aa is a trick I use to get them to show up at the top of the fields list. With the new extracted field I was able to expand as I expected.&lt;/P&gt;

&lt;P&gt;Thanks, Martin!&lt;/P&gt;</description>
      <pubDate>Fri, 24 Oct 2014 18:31:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-there-a-way-to-force-rex-to-be-evaluated-before-mv-functions/m-p/174392#M50040</guid>
      <dc:creator>narduk</dc:creator>
      <dc:date>2014-10-24T18:31:13Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a way to force rex to be evaluated before mv functions?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-there-a-way-to-force-rex-to-be-evaluated-before-mv-functions/m-p/174393#M50041</link>
      <description>&lt;P&gt;Cool. I've converted this to an answer so you can mark that as the solution.&lt;/P&gt;</description>
      <pubDate>Fri, 24 Oct 2014 19:27:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-there-a-way-to-force-rex-to-be-evaluated-before-mv-functions/m-p/174393#M50041</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2014-10-24T19:27:49Z</dc:date>
    </item>
  </channel>
</rss>

