<?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: Duplicate rex field extraction results in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Duplicate-rex-field-extraction-results/m-p/312615#M93602</link>
    <description>&lt;P&gt;I would add a &lt;CODE&gt;bug&lt;/CODE&gt; tag to this question, too.&lt;/P&gt;</description>
    <pubDate>Mon, 29 May 2017 14:36:00 GMT</pubDate>
    <dc:creator>woodcock</dc:creator>
    <dc:date>2017-05-29T14:36:00Z</dc:date>
    <item>
      <title>Duplicate rex field extraction results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Duplicate-rex-field-extraction-results/m-p/312611#M93598</link>
      <description>&lt;P&gt;In my log files there is a field (path = info.message) that has a certain string. I want to extract a part of that string by using "rex". Here is my query:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;rex field="info.message" "- (?&amp;lt;pcc&amp;gt;\S{3,4}) "
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Rex is doing a great job and extracts the value the way I want, but when I try to view results in a table, I get two values in one row, like that (these results are for three log files):&lt;BR /&gt;
&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/2987i64B432ED50EF4B1A/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;Even if I use "dedup pcc" before "table pcc", I still get those duplicate value rows. In logs there is another field called "msg" (path = info.msg) that has the same string as "message", so that can be the cause of this duplication, but my query says that the field should be "info.message", not "info.msg".&lt;/P&gt;

&lt;P&gt;Does anyone know what is the issue here and what am I missing out on?&lt;BR /&gt;
Thanks!!&lt;/P&gt;

&lt;P&gt;UPD:&lt;BR /&gt;
After I removed "field="info.message"" from rex command, the consequent search results came without any duplicates, so this issue has something to do with "field" option in rex.&lt;/P&gt;

&lt;P&gt;UPD2:&lt;BR /&gt;
I have used a workaround with spath and it worked. If you use spath before rex and insert spath's "output" value to rex'es "field", there are no duplicates in results. However, this means that in order to successfully use rex'es "field" option, a user should be aware of spath, which is kind of poor usability, I think.&lt;BR /&gt;
woodcock, is there a chance a feature request could be added to enable rex'es field value to accept full paths (like in my example - "info.message")? Thank you a lot!&lt;/P&gt;

&lt;P&gt;UPD3:&lt;BR /&gt;
Below is a screenshot of the "info.message" field. I erased confidential info, but that is not important, because I am trying to extract the visible 4 symbol code. As you can see, there are 3 unique records but each of them has a count of 2. Also, there is another field that has a path "info.msg" and contains the exact same information as "info.message".&lt;BR /&gt;
DalJeanis, do you know maybe whether rex'es field treats its input not as a path but rather a kind of alias or something? If yes, then how can I know that "info.message" is an alias?&lt;BR /&gt;
&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/2988iE9A273529C40273E/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 26 May 2017 12:00:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Duplicate-rex-field-extraction-results/m-p/312611#M93598</guid>
      <dc:creator>funghorn</dc:creator>
      <dc:date>2017-05-26T12:00:52Z</dc:date>
    </item>
    <item>
      <title>Re: Duplicate rex field extraction results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Duplicate-rex-field-extraction-results/m-p/312612#M93599</link>
      <description>&lt;P&gt;If your description is accurate then this is definitely a bug so I would certainly open a support case with Splunk.&lt;/P&gt;</description>
      <pubDate>Fri, 26 May 2017 15:28:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Duplicate-rex-field-extraction-results/m-p/312612#M93599</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-05-26T15:28:41Z</dc:date>
    </item>
    <item>
      <title>Re: Duplicate rex field extraction results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Duplicate-rex-field-extraction-results/m-p/312613#M93600</link>
      <description>&lt;P&gt;1) Please post an example of the entire _raw that causes the issue, minus any confidential data, plus any parts of your search that extract the info.message &lt;/P&gt;

&lt;P&gt;2) try mvdedup after the field="info.message" option on the rex and see what happens.&lt;/P&gt;</description>
      <pubDate>Fri, 26 May 2017 16:03:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Duplicate-rex-field-extraction-results/m-p/312613#M93600</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2017-05-26T16:03:38Z</dc:date>
    </item>
    <item>
      <title>Re: Duplicate rex field extraction results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Duplicate-rex-field-extraction-results/m-p/312614#M93601</link>
      <description>&lt;P&gt;Remember he said then when he operates on &lt;CODE&gt;_raw&lt;/CODE&gt;, it works fine.  If that's true, then it has to be a bug.&lt;/P&gt;</description>
      <pubDate>Fri, 26 May 2017 16:12:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Duplicate-rex-field-extraction-results/m-p/312614#M93601</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-05-26T16:12:00Z</dc:date>
    </item>
    <item>
      <title>Re: Duplicate rex field extraction results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Duplicate-rex-field-extraction-results/m-p/312615#M93602</link>
      <description>&lt;P&gt;I would add a &lt;CODE&gt;bug&lt;/CODE&gt; tag to this question, too.&lt;/P&gt;</description>
      <pubDate>Mon, 29 May 2017 14:36:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Duplicate-rex-field-extraction-results/m-p/312615#M93602</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-05-29T14:36:00Z</dc:date>
    </item>
    <item>
      <title>Re: Duplicate rex field extraction results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Duplicate-rex-field-extraction-results/m-p/312616#M93603</link>
      <description>&lt;P&gt;Check to see if info.message is an alias for another field as well as an extracted field in its own right.&lt;/P&gt;

&lt;P&gt;That is, do a search that returns one of the records in question, and look at the record's fields to see if info.message has two values.  &lt;/P&gt;</description>
      <pubDate>Tue, 30 May 2017 16:02:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Duplicate-rex-field-extraction-results/m-p/312616#M93603</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2017-05-30T16:02:12Z</dc:date>
    </item>
  </channel>
</rss>

