<?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: Help with regex for a highly confusing field extraction in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Help-with-regex-for-a-highly-confusing-field-extraction/m-p/171184#M49014</link>
    <description>&lt;P&gt;Excluding the 'UV15' is easy - just move that part of the regex outside the field.  I'll update the answer.&lt;/P&gt;

&lt;P&gt;The &lt;CODE&gt;max_match=0&lt;/CODE&gt; option tells rex to match all sets of 38.&lt;/P&gt;</description>
    <pubDate>Wed, 22 Oct 2014 16:55:57 GMT</pubDate>
    <dc:creator>richgalloway</dc:creator>
    <dc:date>2014-10-22T16:55:57Z</dc:date>
    <item>
      <title>Help with regex for a highly confusing field extraction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-regex-for-a-highly-confusing-field-extraction/m-p/171177#M49007</link>
      <description>&lt;P&gt;Hello guys!&lt;BR /&gt;
I know Splunk has a REGEX helper, but in this case, I have an amount of data wich is almost binary, take a look at one event row:&lt;BR /&gt;
Foreach 38 substr I should have a new extracted field and it's also important to consider these two "blank spaces" when they found else consider numbers but always in a 38 sequence starting after XX01, in the original data I don't have the ** to mark the beggining of each field, just used it to show my problem...&lt;/P&gt;

&lt;P&gt;2014-10-2210:13:19XX01*&lt;EM&gt;0003  00000065000000600000000000000000&lt;/EM&gt;&lt;EM&gt;0004  00000000000000000000000200000000&lt;/EM&gt;*0005  000000000000000000000005000000000007010000001700000017000000000000000000080100000024000000230000000000000000000901000000060000000600000000000000000011010000001300000011000000010000000000120100000006000000060000000000000000001301000000060000000700000001000000000013  0000000100000001000000000000000000150100000061000000610000000000000000001511000000670000006700000000000000000015  00000149000001480000000100000000&lt;/P&gt;

&lt;P&gt;Thanks in advance if anybody has a hint on this.&lt;BR /&gt;
Bst Rgrds!&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 17:56:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-regex-for-a-highly-confusing-field-extraction/m-p/171177#M49007</guid>
      <dc:creator>vtsguerrero</dc:creator>
      <dc:date>2020-09-28T17:56:22Z</dc:date>
    </item>
    <item>
      <title>Re: Help with regex for a highly confusing field extraction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-regex-for-a-highly-confusing-field-extraction/m-p/171178#M49008</link>
      <description>&lt;P&gt;Try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | rex max_match=0 "[A-Z]{2}[0-9]{2}(?&amp;lt;sub38&amp;gt;([\d ]{38})" | ...
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This will give you a multivalue variable with all of the matches.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Oct 2014 12:55:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-regex-for-a-highly-confusing-field-extraction/m-p/171178#M49008</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2014-10-22T12:55:44Z</dc:date>
    </item>
    <item>
      <title>Re: Help with regex for a highly confusing field extraction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-regex-for-a-highly-confusing-field-extraction/m-p/171179#M49009</link>
      <description>&lt;P&gt;Almost on the way I guess, shoud I use this rex in search tab or interactive field extractor?&lt;BR /&gt;
There's just something else, these blocks, don't always start by XX01, they can vary for other letters AB, CD, DA, and so on...&lt;BR /&gt;
If I use this rex match in search how will I extract it to a fixed field? Should use it inside field extractor right?&lt;BR /&gt;
Thanks a lot @richgalloway&lt;/P&gt;</description>
      <pubDate>Wed, 22 Oct 2014 13:23:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-regex-for-a-highly-confusing-field-extraction/m-p/171179#M49009</guid>
      <dc:creator>vtsguerrero</dc:creator>
      <dc:date>2014-10-22T13:23:42Z</dc:date>
    </item>
    <item>
      <title>Re: Help with regex for a highly confusing field extraction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-regex-for-a-highly-confusing-field-extraction/m-p/171180#M49010</link>
      <description>&lt;P&gt;Use this command in the search tab and it will extract the data into a multivalue variable (sub38, in my example).  You then can manipulate the variable using the various &lt;CODE&gt;mv*&lt;/CODE&gt; commands.&lt;/P&gt;

&lt;P&gt;I've modified my answer to accommodate eye-catchers other than 'XX'. &lt;/P&gt;</description>
      <pubDate>Wed, 22 Oct 2014 13:29:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-regex-for-a-highly-confusing-field-extraction/m-p/171180#M49010</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2014-10-22T13:29:11Z</dc:date>
    </item>
    <item>
      <title>Re: Help with regex for a highly confusing field extraction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-regex-for-a-highly-confusing-field-extraction/m-p/171181#M49011</link>
      <description>&lt;P&gt;Sorry bothering again, but just compared some fields and they also may not always use 01 after two letters, take a look at this other entry:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;2014-10-2211:31:41UV020003  000001380000011800000014000000000004  000000000000000000000011000000010005  0000000000000000000000070000000000070100000041000000410000000000000000000801000000530000004300000002000000000009010000000400000004000000000000000000110100000011000000100000000000000000001201000000050000000500000000000000000013010000001300000014000000000000000000150100000144000001430000000100000000001511000000430000004200000001000000000015  00000309000003050000000400000000
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Is there any table command I could use after this | rex expression just to confirm if selected fields are ok to extract in seach?&lt;BR /&gt;
Thanks a lot @richgalloway&lt;/P&gt;</description>
      <pubDate>Wed, 22 Oct 2014 13:35:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-regex-for-a-highly-confusing-field-extraction/m-p/171181#M49011</guid>
      <dc:creator>vtsguerrero</dc:creator>
      <dc:date>2014-10-22T13:35:18Z</dc:date>
    </item>
    <item>
      <title>Re: Help with regex for a highly confusing field extraction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-regex-for-a-highly-confusing-field-extraction/m-p/171182#M49012</link>
      <description>&lt;P&gt;Replace '01' in the &lt;CODE&gt;rex&lt;/CODE&gt; command with '[0-9]{2}'.  I'll update my answer.&lt;/P&gt;

&lt;P&gt;You should be able to see the extracted field with a &lt;CODE&gt;table sub38&lt;/CODE&gt; command.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Oct 2014 13:43:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-regex-for-a-highly-confusing-field-extraction/m-p/171182#M49012</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2014-10-22T13:43:02Z</dc:date>
    </item>
    <item>
      <title>Re: Help with regex for a highly confusing field extraction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-regex-for-a-highly-confusing-field-extraction/m-p/171183#M49013</link>
      <description>&lt;P&gt;It's starting at the letters... I need it to start considering after two letters and two numbers, look:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; UV150003 00000192000001700000001000000000 - UV15 shoud not be considered.
 TF900013 00000000000000010000000000000000 - TF90 shoud not be considered.
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;But I need the blank spaces after 3 and before 0 to be considered in the extraction. Just one more question, will this work every 38 substr or just for first 38?&lt;/P&gt;</description>
      <pubDate>Wed, 22 Oct 2014 16:00:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-regex-for-a-highly-confusing-field-extraction/m-p/171183#M49013</guid>
      <dc:creator>vtsguerrero</dc:creator>
      <dc:date>2014-10-22T16:00:29Z</dc:date>
    </item>
    <item>
      <title>Re: Help with regex for a highly confusing field extraction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-regex-for-a-highly-confusing-field-extraction/m-p/171184#M49014</link>
      <description>&lt;P&gt;Excluding the 'UV15' is easy - just move that part of the regex outside the field.  I'll update the answer.&lt;/P&gt;

&lt;P&gt;The &lt;CODE&gt;max_match=0&lt;/CODE&gt; option tells rex to match all sets of 38.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Oct 2014 16:55:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-regex-for-a-highly-confusing-field-extraction/m-p/171184#M49014</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2014-10-22T16:55:57Z</dc:date>
    </item>
    <item>
      <title>Re: Help with regex for a highly confusing field extraction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-regex-for-a-highly-confusing-field-extraction/m-p/171185#M49015</link>
      <description>&lt;P&gt;It worked! The regex is perfect now! The only problem, it's just gettin' the first 38 subsrt, this is a complete log:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;2010-05-2215:04:16XX050003  000001310000012000000010000000010004  000000000000000000000004000000000005  0000000000000000000000080000000000070100000068000000670000000000000000000801000000730000006200000000000000000009010000001200000012000000000000000000110100000026000000210000000100000000001201000000080000000800000000000000000013010000001200000011000000020000000000150100000134000001340000000000000000001511000000380000003800000000000000000015  00000315000003090000000600000000
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And when I use the rex and table, it worked fine, for the first 38&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;rex max_match=0 "[A-Z]{2}[0-9]{2}(?&amp;lt;sub38&amp;gt;([\d ]{38}))" | table sub38
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Show as result:&lt;/P&gt;

&lt;P&gt;0003 00000131000001200000001000000001&lt;/P&gt;

&lt;P&gt;Shoud this table show the rest, starting from 0004 and on as I need to extract as one single field?&lt;BR /&gt;
Thanks in advance @richgalloway&lt;/P&gt;</description>
      <pubDate>Wed, 22 Oct 2014 17:09:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-regex-for-a-highly-confusing-field-extraction/m-p/171185#M49015</guid>
      <dc:creator>vtsguerrero</dc:creator>
      <dc:date>2014-10-22T17:09:07Z</dc:date>
    </item>
    <item>
      <title>Re: Help with regex for a highly confusing field extraction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-regex-for-a-highly-confusing-field-extraction/m-p/171186#M49016</link>
      <description>&lt;P&gt;You can use the &lt;CODE&gt;mvcount&lt;/CODE&gt; command to verify more than one substr is matched.  For example, &lt;CODE&gt;rex... | eval count=mvcount(sub38) | table count&lt;/CODE&gt;.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Oct 2014 17:17:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-regex-for-a-highly-confusing-field-extraction/m-p/171186#M49016</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2014-10-22T17:17:54Z</dc:date>
    </item>
    <item>
      <title>Re: Help with regex for a highly confusing field extraction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-regex-for-a-highly-confusing-field-extraction/m-p/171187#M49017</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;count
1
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;My count is 1, refeers to 0003 00000131000001200000001000000001 only first substr...&lt;/P&gt;</description>
      <pubDate>Wed, 22 Oct 2014 17:36:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-regex-for-a-highly-confusing-field-extraction/m-p/171187#M49017</guid>
      <dc:creator>vtsguerrero</dc:creator>
      <dc:date>2014-10-22T17:36:35Z</dc:date>
    </item>
    <item>
      <title>Re: Help with regex for a highly confusing field extraction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-regex-for-a-highly-confusing-field-extraction/m-p/171188#M49018</link>
      <description>&lt;P&gt;I think I see what is happening.  There is only one instance per event of 'XX01' followed by 38 characters.  This is trickier than I thought.  Perhaps we can do this in two separate operations.  Use &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;rex "[A-Z]{2}[0-9]{2}(?&amp;lt;subs&amp;gt;[\d ]+)"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;to extract everything after 'XX01' then use&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;rex field=subs max_match=0 "(?&amp;lt;sub38&amp;gt;[\d ]{38})"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;to break the result into 38-character chunks.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Oct 2014 17:54:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-regex-for-a-highly-confusing-field-extraction/m-p/171188#M49018</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2014-10-22T17:54:59Z</dc:date>
    </item>
    <item>
      <title>Re: Help with regex for a highly confusing field extraction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-regex-for-a-highly-confusing-field-extraction/m-p/171189#M49019</link>
      <description>&lt;P&gt;Got it, working perfectly now @richgalloway...&lt;BR /&gt;
I just changed the beggining to [A-Za-z] &lt;BR /&gt;
But there's something else... I'm now working with two rex, I saved the first one into an extraction field and now I've calling this field in the second rex...&lt;BR /&gt;
I have some subfields I have to create for each 38 chunk, I did it like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval A = substr(sub38,1,4)
| eval B = substr(sub38,5,2)
| eval C = substr(sub38,7,8)
| eval D = substr(sub38,15,8)
| eval E = substr(sub38,16,8)
| eval F = substr(sub38,24,8)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Consdering that substr function starts at first argument and moves to second argument position number, I need to extract for the first field 4 values of the chunk, for the second field 2 values of the chunk and the rest 8 values for fours fields subsequent.&lt;BR /&gt;
But if I do that using eval substr I only get the first 38 chunk as a result and I needed for all event's chunk, any suggestion on how I could possibly do that?&lt;BR /&gt;
Thanks in advance @richgalloway !&lt;/P&gt;</description>
      <pubDate>Thu, 23 Oct 2014 14:19:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-regex-for-a-highly-confusing-field-extraction/m-p/171189#M49019</guid>
      <dc:creator>vtsguerrero</dc:creator>
      <dc:date>2014-10-23T14:19:36Z</dc:date>
    </item>
    <item>
      <title>Re: Help with regex for a highly confusing field extraction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-regex-for-a-highly-confusing-field-extraction/m-p/171190#M49020</link>
      <description>&lt;P&gt;I've about reached the limit of my experience and understanding of multi-value fields.   I suggest you open a new question.&lt;/P&gt;</description>
      <pubDate>Thu, 23 Oct 2014 14:39:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-regex-for-a-highly-confusing-field-extraction/m-p/171190#M49020</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2014-10-23T14:39:28Z</dc:date>
    </item>
    <item>
      <title>Re: Help with regex for a highly confusing field extraction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-regex-for-a-highly-confusing-field-extraction/m-p/171191#M49021</link>
      <description>&lt;P&gt;Okay bro, thanks in advance for the hints...&lt;/P&gt;</description>
      <pubDate>Thu, 23 Oct 2014 16:15:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-regex-for-a-highly-confusing-field-extraction/m-p/171191#M49021</guid>
      <dc:creator>vtsguerrero</dc:creator>
      <dc:date>2014-10-23T16:15:47Z</dc:date>
    </item>
  </channel>
</rss>

