<?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: Field Extaction from regex not displaying Character in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Field-Extaction-from-regex-not-displaying-Character/m-p/126597#M34284</link>
    <description>&lt;P&gt;On your sample data, the following regex extracts the letters:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;\*{2}(?P&amp;lt;FIELDNAME&amp;gt;[^\*]+)\*{2}
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;MATCH 1&lt;BR /&gt;
FIELDNAME   [150-157]   &lt;CODE&gt;b s i r&lt;/CODE&gt;&lt;BR /&gt;
MATCH 2&lt;BR /&gt;
FIELDNAME   [339-346]   &lt;CODE&gt;b n p r&lt;/CODE&gt;&lt;BR /&gt;
MATCH 3&lt;BR /&gt;
FIELDNAME   [539-546]   &lt;CODE&gt;a n i r&lt;/CODE&gt;&lt;BR /&gt;
MATCH 4&lt;BR /&gt;
FIELDNAME   [756-763]   &lt;CODE&gt;a s o r&lt;/CODE&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;' It allows me to extract the combinations as individual characters into a field until I add I add the character "b" '
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If I understood correctly about the part of matching everything until you get to a "b", the regex becomes:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;\*{2}(?P&amp;lt;FIELDNAME&amp;gt;[^b\*]+)\*{2}
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;MATCH 1&lt;BR /&gt;
FIELDNAME   [539-546]   &lt;CODE&gt;a n i r&lt;/CODE&gt;&lt;BR /&gt;
MATCH 2&lt;BR /&gt;
FIELDNAME   [756-763]   &lt;CODE&gt;a s o r&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;You can then use makemv command to create a multivalue field of each string of single characters.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rex "\*{2}(?P&amp;lt;FIELDNAME&amp;gt;[^b\*]+)\*{2}"
| makemv FIELDNAME delim=" " allowempty=t
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 20 Jul 2015 15:28:56 GMT</pubDate>
    <dc:creator>landen99</dc:creator>
    <dc:date>2015-07-20T15:28:56Z</dc:date>
    <item>
      <title>Field Extaction from regex not displaying Character</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Field-Extaction-from-regex-not-displaying-Character/m-p/126592#M34279</link>
      <description>&lt;P&gt;Hi, I have an issue  for extracting values.  It extracts 7 out of the 8 characters I need to catch.&lt;BR /&gt;
 I currently have this:  &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index=gfs_etd_mft  source="/opt/TMWD/SecureTransport/var/logs/xferlog" | rex field=_raw "(?i)\..*? (?P&amp;lt;FIELDNAME&amp;gt;**[i|n|p|o|r|a|j])**" | dedup FIELDNAME | table FIELDNAME
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;It does return all the characters listed in the regex onto the statistics table. However, when I add the character "b&lt;CODE&gt;"( rex field=_raw "(?i)\..*? (?P&amp;amp;lt;FIELDNAME&amp;amp;gt;**[i|n|b|p|o|r|a|j]**)")&lt;/CODE&gt;, it only displays  "a" and "b" in stats table.  How do I correct?&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jul 2015 22:03:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Field-Extaction-from-regex-not-displaying-Character/m-p/126592#M34279</guid>
      <dc:creator>pmcfadden91</dc:creator>
      <dc:date>2015-07-16T22:03:31Z</dc:date>
    </item>
    <item>
      <title>Re: Field Extaction from regex not displaying Character</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Field-Extaction-from-regex-not-displaying-Character/m-p/126593#M34280</link>
      <description>&lt;P&gt;can you provide some log samples?&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jul 2015 22:32:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Field-Extaction-from-regex-not-displaying-Character/m-p/126593#M34280</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2015-07-16T22:32:24Z</dc:date>
    </item>
    <item>
      <title>Re: Field Extaction from regex not displaying Character</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Field-Extaction-from-regex-not-displaying-Character/m-p/126594#M34281</link>
      <description>&lt;P&gt;It looks like your &lt;CODE&gt;character class&lt;/CODE&gt; is inefficient and you are not escaping your asterisks; try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=gfs_etd_mft  source="/opt/TMWD/SecureTransport/var/logs/xferlog" | rex field=_raw "(?i)\..*? (?&amp;lt;FIELDNAME&amp;gt;\*\*[inbporaj])\*\*" | dedup FIELDNAME | table FIELDNAME
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 16 Jul 2015 23:24:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Field-Extaction-from-regex-not-displaying-Character/m-p/126594#M34281</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2015-07-16T23:24:42Z</dc:date>
    </item>
    <item>
      <title>Re: Field Extaction from regex not displaying Character</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Field-Extaction-from-regex-not-displaying-Character/m-p/126595#M34282</link>
      <description>&lt;P&gt;Your regex indicates that there may be a pattern like ".stuff **a**"  We really need to see the raw data and the desired result before we can understand the best regex for it.  I am thinking that the following may extract you results much better:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=gfs_etd_mft  source="/opt/TMWD/SecureTransport/var/logs/xferlog" | rex field=_raw "(?i)\*{2}(?&amp;lt;FIELDNAME&amp;gt;[inbporaj])\*{2}" | dedup FIELDNAME | table FIELDNAME
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 17 Jul 2015 12:45:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Field-Extaction-from-regex-not-displaying-Character/m-p/126595#M34282</guid>
      <dc:creator>landen99</dc:creator>
      <dc:date>2015-07-17T12:45:55Z</dc:date>
    </item>
    <item>
      <title>Re: Field Extaction from regex not displaying Character</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Field-Extaction-from-regex-not-displaying-Character/m-p/126596#M34283</link>
      <description>&lt;P&gt;Below are some log examples:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;Fri Jul 17 14:22:15 2015 0 139.149.36.161 10032 /sbclocal/InternalSecureFileTransfer/users/ETDIT/gmiprod2skctest/chi/global_idt/comm/idts_00104.zip **b s i r** gmiprod2skctest ssh 0 *&lt;/CODE&gt;    &lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;Fri Jul 17 11:28:10 2015 0 localhost 0 /sbclocal/InternalSecureFileTransfer/users/ETDIT/gmi_test_ftp/gmi_to_skc/gmi/SKCU02/asia_memo/account_types.zip **b n p r** gmi_test_ftp folder 0 *&lt;/CODE&gt; &lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;Fri Jul 17 11:03:29 2015 8 151.191.80.226 3341520 /sbclocal/InternalSecureFileTransfer/users/ETDIT/tpt_ftp_test/outbox/rexuat/ldn/GMI_OBS_IRSCME_POS_20150716.txt **a n i r** tpt_ftp_test ftp 0 *&lt;/CODE&gt; &lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;Fri Jul 17 11:03:29 2015 1 rex_ldn_uat1_cmp.ldn.swissbank.com 3341520 /sbclocal/InternalSecureFileTransfer/users/ETDIT/tpt_ftp_test/outbox/rexuat/ldn/GMI_OBS_IRSCME_POS_20150716.txt **a s o r** tpt_ftp_test ssh 0 *&lt;/CODE&gt; &lt;/P&gt;

&lt;P&gt;It allows me to extract the combinations as individual characters into a field until I add I add the character "b".  Also I was wondering if there is a way to extract different combinations(as shown in examples) and the single characters of the combos all into one field? I have a regex that pulls all combinations now. I just wanted to combine them.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index=gfs_etd_mft  source="/opt/TMWD/SecureTransport/var/logs/xferlog" | rex field=_raw "(?i)\..*? (?P&amp;lt;FIELDNAME&amp;gt;\w+\s+\w+\s+\w+\s+\w+)\s+\w+" | dedup FIELDNAME | table FIELDNAME
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 20 Jul 2015 14:38:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Field-Extaction-from-regex-not-displaying-Character/m-p/126596#M34283</guid>
      <dc:creator>pmcfadden91</dc:creator>
      <dc:date>2015-07-20T14:38:33Z</dc:date>
    </item>
    <item>
      <title>Re: Field Extaction from regex not displaying Character</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Field-Extaction-from-regex-not-displaying-Character/m-p/126597#M34284</link>
      <description>&lt;P&gt;On your sample data, the following regex extracts the letters:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;\*{2}(?P&amp;lt;FIELDNAME&amp;gt;[^\*]+)\*{2}
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;MATCH 1&lt;BR /&gt;
FIELDNAME   [150-157]   &lt;CODE&gt;b s i r&lt;/CODE&gt;&lt;BR /&gt;
MATCH 2&lt;BR /&gt;
FIELDNAME   [339-346]   &lt;CODE&gt;b n p r&lt;/CODE&gt;&lt;BR /&gt;
MATCH 3&lt;BR /&gt;
FIELDNAME   [539-546]   &lt;CODE&gt;a n i r&lt;/CODE&gt;&lt;BR /&gt;
MATCH 4&lt;BR /&gt;
FIELDNAME   [756-763]   &lt;CODE&gt;a s o r&lt;/CODE&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;' It allows me to extract the combinations as individual characters into a field until I add I add the character "b" '
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If I understood correctly about the part of matching everything until you get to a "b", the regex becomes:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;\*{2}(?P&amp;lt;FIELDNAME&amp;gt;[^b\*]+)\*{2}
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;MATCH 1&lt;BR /&gt;
FIELDNAME   [539-546]   &lt;CODE&gt;a n i r&lt;/CODE&gt;&lt;BR /&gt;
MATCH 2&lt;BR /&gt;
FIELDNAME   [756-763]   &lt;CODE&gt;a s o r&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;You can then use makemv command to create a multivalue field of each string of single characters.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rex "\*{2}(?P&amp;lt;FIELDNAME&amp;gt;[^b\*]+)\*{2}"
| makemv FIELDNAME delim=" " allowempty=t
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 20 Jul 2015 15:28:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Field-Extaction-from-regex-not-displaying-Character/m-p/126597#M34284</guid>
      <dc:creator>landen99</dc:creator>
      <dc:date>2015-07-20T15:28:56Z</dc:date>
    </item>
    <item>
      <title>Re: Field Extaction from regex not displaying Character</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Field-Extaction-from-regex-not-displaying-Character/m-p/126598#M34285</link>
      <description>&lt;P&gt;This worked when I plugged it in and tweaked a bit. Thanks!&lt;/P&gt;</description>
      <pubDate>Mon, 20 Jul 2015 16:23:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Field-Extaction-from-regex-not-displaying-Character/m-p/126598#M34285</guid>
      <dc:creator>pmcfadden91</dc:creator>
      <dc:date>2015-07-20T16:23:01Z</dc:date>
    </item>
    <item>
      <title>Re: Field Extaction from regex not displaying Character</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Field-Extaction-from-regex-not-displaying-Character/m-p/126599#M34286</link>
      <description>&lt;P&gt;No problem.  I used regex101.com to craft the regex.  Try it out if you like.&lt;/P&gt;</description>
      <pubDate>Mon, 20 Jul 2015 17:01:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Field-Extaction-from-regex-not-displaying-Character/m-p/126599#M34286</guid>
      <dc:creator>landen99</dc:creator>
      <dc:date>2015-07-20T17:01:50Z</dc:date>
    </item>
  </channel>
</rss>

