<?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: Why am I getting an error when doing field extraction with the field extractor tool? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Why-am-I-getting-an-error-when-doing-field-extraction-with-the/m-p/389660#M113531</link>
    <description>&lt;P&gt;tried this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=WPG
 | eval _raw="&amp;lt;pfId&amp;gt;208431&amp;lt;/pfId&amp;gt;&amp;lt;isoId&amp;gt;208431&amp;lt;/isoId&amp;gt;"
 | rex field=_raw "\&amp;lt;pfId\&amp;gt;(?&amp;lt;pfId&amp;gt;.*?)\&amp;lt;\/pfId\&amp;gt;"
 | rex field=_raw "\&amp;lt;isoId\&amp;gt;(?&amp;lt;isoId&amp;gt;.*?)\&amp;lt;\/isoId\&amp;gt;" | table pfId, isoId | transpose |
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&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/5213i1E55C56B78A36B74/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;and it works !&lt;BR /&gt;
given that there was only two main IDs used for both pfID and isoID I've gone with a pie chart.&lt;/P&gt;

&lt;P&gt;Thanks everyone for your help really appreciate it. &lt;/P&gt;</description>
    <pubDate>Wed, 20 Jun 2018 16:08:03 GMT</pubDate>
    <dc:creator>tanp685</dc:creator>
    <dc:date>2018-06-20T16:08:03Z</dc:date>
    <item>
      <title>Why am I getting an error when doing field extraction with the field extractor tool?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-am-I-getting-an-error-when-doing-field-extraction-with-the/m-p/389655#M113526</link>
      <description>&lt;P&gt;I'm trying to extract a field with the field extractor tool, however, keep getting errors back&lt;/P&gt;

&lt;P&gt;This is a part of the sample log event containing the fields: &lt;BR /&gt;
&lt;CODE&gt;&amp;lt;pfId&amp;gt;208431&amp;lt;/pfId&amp;gt;&amp;lt;isoId&amp;gt;208431&amp;lt;/isoId&amp;gt;&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;both these fields tend to have the same values most of the time, and I'm trying to root out instances where they don't have the same values. So tried to display them with the query &lt;BR /&gt;
&lt;CODE&gt;| table pfId, isoId&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;but it doesn't work - shows up as empty tables&lt;/P&gt;

&lt;P&gt;Appreciate any help I can get with this.&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jun 2018 12:42:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-am-I-getting-an-error-when-doing-field-extraction-with-the/m-p/389655#M113526</guid>
      <dc:creator>tanp685</dc:creator>
      <dc:date>2018-06-20T12:42:45Z</dc:date>
    </item>
    <item>
      <title>Re: Why am I getting an error when doing field extraction with the field extractor tool?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-am-I-getting-an-error-when-doing-field-extraction-with-the/m-p/389656#M113527</link>
      <description>&lt;P&gt;Are the fields extracted? You state that you keep getting errors with the &lt;EM&gt;Field Extraction Tool&lt;/EM&gt;, so I'm assuming that you aren't getting the fields when you try to do the &lt;CODE&gt;table&lt;/CODE&gt; command because if the fields are empty, you will get no data from the &lt;CODE&gt;table&lt;/CODE&gt; command.&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jun 2018 13:49:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-am-I-getting-an-error-when-doing-field-extraction-with-the/m-p/389656#M113527</guid>
      <dc:creator>cpetterborg</dc:creator>
      <dc:date>2018-06-20T13:49:01Z</dc:date>
    </item>
    <item>
      <title>Re: Why am I getting an error when doing field extraction with the field extractor tool?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-am-I-getting-an-error-when-doing-field-extraction-with-the/m-p/389657#M113528</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;... | rex "\&amp;lt;pfId\&amp;gt;(?&amp;lt;pfId&amp;gt;\d+?)\&amp;lt;" |  | rex "\&amp;lt;isoId\&amp;gt;(?&amp;lt;isoId&amp;gt;\d+?)\&amp;lt;"  | search pfId=isoId | table pfId, isoId
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 20 Jun 2018 13:52:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-am-I-getting-an-error-when-doing-field-extraction-with-the/m-p/389657#M113528</guid>
      <dc:creator>solarboyz1</dc:creator>
      <dc:date>2018-06-20T13:52:32Z</dc:date>
    </item>
    <item>
      <title>Re: Why am I getting an error when doing field extraction with the field extractor tool?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-am-I-getting-an-error-when-doing-field-extraction-with-the/m-p/389658#M113529</link>
      <description>&lt;P&gt;Something in the spirit of &lt;CODE&gt;\&amp;lt;pfId\&amp;gt;(.*?)\&amp;lt;\/pfId\&amp;gt;&lt;/CODE&gt; should work.&lt;/P&gt;

&lt;P&gt;Please use - &lt;A href="https://regex101.com/"&gt;Regular expressions 101 &lt;/A&gt;&lt;/P&gt;

&lt;P&gt;A good thread - &lt;A href="https://answers.splunk.com/answers/48909/splunking-html-formatted-log-files.html"&gt;Splunking HTML Formatted Log Files&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Please test with -&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=&amp;lt;any index&amp;gt;
| eval _raw="&amp;lt;pfId&amp;gt;208431&amp;lt;/pfId&amp;gt;&amp;lt;isoId&amp;gt;208431&amp;lt;/isoId&amp;gt;"
| rex field=_raw "\&amp;lt;pfId\&amp;gt;(?&amp;lt;pfId&amp;gt;.*?)\&amp;lt;\/pfId\&amp;gt;"
| rex field=_raw "\&amp;lt;isoId\&amp;gt;(?&amp;lt;isoId&amp;gt;.*?)\&amp;lt;\/isoId\&amp;gt;"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;It should produce the &lt;CODE&gt;pfId&lt;/CODE&gt; and &lt;CODE&gt;isoId&lt;/CODE&gt; fields.&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jun 2018 13:52:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-am-I-getting-an-error-when-doing-field-extraction-with-the/m-p/389658#M113529</guid>
      <dc:creator>ddrillic</dc:creator>
      <dc:date>2018-06-20T13:52:48Z</dc:date>
    </item>
    <item>
      <title>Re: Why am I getting an error when doing field extraction with the field extractor tool?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-am-I-getting-an-error-when-doing-field-extraction-with-the/m-p/389659#M113530</link>
      <description>&lt;P&gt;If you want help resolving your issues with the field extractor, it would help if you would explain your attempts and the errors you got.&lt;/P&gt;

&lt;P&gt;A simple rex command solution to extract these two fields in your query could look like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rex "pfId\&amp;gt;(?&amp;lt;pfId&amp;gt;[^\&amp;gt;]+)"
| rex "isoId\&amp;gt;(?&amp;lt;isoId&amp;gt;[^\&amp;gt;]+)"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Alternatively, you could have a look at the &lt;CODE&gt;xmlkv&lt;/CODE&gt; command: &lt;A href="http://docs.splunk.com/Documentation/Splunk/7.0.1/SearchReference/Xmlkv"&gt;http://docs.splunk.com/Documentation/Splunk/7.0.1/SearchReference/Xmlkv&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jun 2018 14:02:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-am-I-getting-an-error-when-doing-field-extraction-with-the/m-p/389659#M113530</guid>
      <dc:creator>FrankVl</dc:creator>
      <dc:date>2018-06-20T14:02:30Z</dc:date>
    </item>
    <item>
      <title>Re: Why am I getting an error when doing field extraction with the field extractor tool?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-am-I-getting-an-error-when-doing-field-extraction-with-the/m-p/389660#M113531</link>
      <description>&lt;P&gt;tried this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=WPG
 | eval _raw="&amp;lt;pfId&amp;gt;208431&amp;lt;/pfId&amp;gt;&amp;lt;isoId&amp;gt;208431&amp;lt;/isoId&amp;gt;"
 | rex field=_raw "\&amp;lt;pfId\&amp;gt;(?&amp;lt;pfId&amp;gt;.*?)\&amp;lt;\/pfId\&amp;gt;"
 | rex field=_raw "\&amp;lt;isoId\&amp;gt;(?&amp;lt;isoId&amp;gt;.*?)\&amp;lt;\/isoId\&amp;gt;" | table pfId, isoId | transpose |
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&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/5213i1E55C56B78A36B74/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;and it works !&lt;BR /&gt;
given that there was only two main IDs used for both pfID and isoID I've gone with a pie chart.&lt;/P&gt;

&lt;P&gt;Thanks everyone for your help really appreciate it. &lt;/P&gt;</description>
      <pubDate>Wed, 20 Jun 2018 16:08:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-am-I-getting-an-error-when-doing-field-extraction-with-the/m-p/389660#M113531</guid>
      <dc:creator>tanp685</dc:creator>
      <dc:date>2018-06-20T16:08:03Z</dc:date>
    </item>
    <item>
      <title>Re: Why am I getting an error when doing field extraction with the field extractor tool?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-am-I-getting-an-error-when-doing-field-extraction-with-the/m-p/389661#M113532</link>
      <description>&lt;P&gt;tried it and it works thanks !&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jun 2018 16:09:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-am-I-getting-an-error-when-doing-field-extraction-with-the/m-p/389661#M113532</guid>
      <dc:creator>tanp685</dc:creator>
      <dc:date>2018-06-20T16:09:15Z</dc:date>
    </item>
    <item>
      <title>Re: Why am I getting an error when doing field extraction with the field extractor tool?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-am-I-getting-an-error-when-doing-field-extraction-with-the/m-p/389662#M113533</link>
      <description>&lt;P&gt;no they weren't. but the &lt;CODE&gt;rex&lt;/CODE&gt; commands worked. &lt;/P&gt;</description>
      <pubDate>Wed, 20 Jun 2018 16:09:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-am-I-getting-an-error-when-doing-field-extraction-with-the/m-p/389662#M113533</guid>
      <dc:creator>tanp685</dc:creator>
      <dc:date>2018-06-20T16:09:54Z</dc:date>
    </item>
    <item>
      <title>Re: Why am I getting an error when doing field extraction with the field extractor tool?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-am-I-getting-an-error-when-doing-field-extraction-with-the/m-p/389663#M113534</link>
      <description>&lt;P&gt;thanks! it works&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jun 2018 16:10:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-am-I-getting-an-error-when-doing-field-extraction-with-the/m-p/389663#M113534</guid>
      <dc:creator>tanp685</dc:creator>
      <dc:date>2018-06-20T16:10:09Z</dc:date>
    </item>
    <item>
      <title>Re: Why am I getting an error when doing field extraction with the field extractor tool?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-am-I-getting-an-error-when-doing-field-extraction-with-the/m-p/389664#M113535</link>
      <description>&lt;P&gt;thanks ! tried it. &lt;/P&gt;</description>
      <pubDate>Wed, 20 Jun 2018 16:10:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-am-I-getting-an-error-when-doing-field-extraction-with-the/m-p/389664#M113535</guid>
      <dc:creator>tanp685</dc:creator>
      <dc:date>2018-06-20T16:10:22Z</dc:date>
    </item>
    <item>
      <title>Re: Why am I getting an error when doing field extraction with the field extractor tool?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-am-I-getting-an-error-when-doing-field-extraction-with-the/m-p/389665#M113536</link>
      <description>&lt;P&gt;@tanp685 - great to hear - btw, it's customary to drop on us some good points if we are helpful ; -)&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jun 2018 16:41:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-am-I-getting-an-error-when-doing-field-extraction-with-the/m-p/389665#M113536</guid>
      <dc:creator>ddrillic</dc:creator>
      <dc:date>2018-06-20T16:41:29Z</dc:date>
    </item>
    <item>
      <title>Re: Why am I getting an error when doing field extraction with the field extractor tool?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-am-I-getting-an-error-when-doing-field-extraction-with-the/m-p/389666#M113537</link>
      <description>&lt;P&gt;I've converted this comment to an Answer. @tanp685 - You can up-vote this answer, and still accept your own answer for your question, or accept this answer if you would like to do that.&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jun 2018 17:44:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-am-I-getting-an-error-when-doing-field-extraction-with-the/m-p/389666#M113537</guid>
      <dc:creator>cpetterborg</dc:creator>
      <dc:date>2018-06-20T17:44:17Z</dc:date>
    </item>
  </channel>
</rss>

