<?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: How can I extract text between 2 standard texts that may contain &amp;quot; . , ? / &amp;quot; ? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-extract-text-between-2-standard-texts-that-may-contain/m-p/113138#M29724</link>
    <description>&lt;P&gt;I still don't see the same regex as is in my answer.  Try removing the stats command to see if you're getting data extracted from the events.&lt;/P&gt;</description>
    <pubDate>Fri, 10 Jul 2015 16:45:09 GMT</pubDate>
    <dc:creator>richgalloway</dc:creator>
    <dc:date>2015-07-10T16:45:09Z</dc:date>
    <item>
      <title>How can I extract text between 2 standard texts that may contain " . , ? / " ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-extract-text-between-2-standard-texts-that-may-contain/m-p/113133#M29719</link>
      <description>&lt;P&gt;I have this type of log: &lt;/P&gt;

&lt;P&gt;Bin:456852 IssuingBank:PBS INTERNATIONAL A/S;DANSKE BANK;DANSKEBANK IssingCountry:DK IRF: Intra EEA CardProfile1:Consumer CardProfile2:Base&lt;/P&gt;

&lt;P&gt;How can I extract : bank, issingcountry, IRF, Cardprofile1, CardProfile2? and then stats count by bank, issingcountry,IRF, Cardprofile1....&lt;/P&gt;

&lt;P&gt;Can anyone please help me with this?   anything I found in the forum did not work!&lt;/P&gt;

&lt;P&gt;I tried something like this but I suppose I need sth upper level regex!&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;rex field=_raw "IssingCountry:(?&amp;lt;issingcountry&amp;gt;\w{2})" | rex field=_raw "IssuingBank:(?&amp;lt;bank&amp;gt;\w{13})"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 10 Jul 2015 14:35:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-extract-text-between-2-standard-texts-that-may-contain/m-p/113133#M29719</guid>
      <dc:creator>kostasKats</dc:creator>
      <dc:date>2015-07-10T14:35:13Z</dc:date>
    </item>
    <item>
      <title>Re: How can I extract text between 2 standard texts that may contain " . , ? / " ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-extract-text-between-2-standard-texts-that-may-contain/m-p/113134#M29720</link>
      <description>&lt;P&gt;This should be helpful:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | rex "IssuingBank:(?P&amp;lt;bank&amp;gt;.+).*?IssingCountry:(?P&amp;lt;issingcountry&amp;gt;\w+) IRF: (?&amp;lt;IRF&amp;gt;[ \w]+) CardProfile1:(?&amp;lt;cardProfile1&amp;gt;\w+) CardProfile2:(?P&amp;lt;cardProfile2&amp;gt;\w+)" | stats count by bank, issingcountry, IRF, cardProfile1
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 10 Jul 2015 14:51:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-extract-text-between-2-standard-texts-that-may-contain/m-p/113134#M29720</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2015-07-10T14:51:21Z</dc:date>
    </item>
    <item>
      <title>Re: How can I extract text between 2 standard texts that may contain " . , ? / " ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-extract-text-between-2-standard-texts-that-may-contain/m-p/113135#M29721</link>
      <description>&lt;P&gt;Unfortunately it did not work! &lt;/P&gt;

&lt;P&gt;The log is :&lt;/P&gt;

&lt;P&gt;row1.....&lt;BR /&gt;
row2.... &lt;BR /&gt;
row3....&lt;BR /&gt;
row4....&lt;/P&gt;

&lt;P&gt;18:00:19,727 INFO  FlightsCostBasedGatewaySorter 5fd00a8d271411e598e306695ac8a534 BinInfo for Bin:656814 IssuingBank:SANTANDER, UK ?PLC IssingCountry:GB IRF:Intra EEA CardProfile1:Consumer CardProfile2:Base&lt;/P&gt;

&lt;P&gt;I used this: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;rex field=_raw "IssuingBank:(?P.+).*?IssingCountry:(?P\w+) IRF: (?[ \w]+) CardProfile1:(?\w+) CardProfile2:(?P\w+)" | stats count by bank, issingcountry, IRF, cardProfile1
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 10 Jul 2015 15:36:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-extract-text-between-2-standard-texts-that-may-contain/m-p/113135#M29721</guid>
      <dc:creator>kostasKats</dc:creator>
      <dc:date>2015-07-10T15:36:36Z</dc:date>
    </item>
    <item>
      <title>Re: How can I extract text between 2 standard texts that may contain " . , ? / " ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-extract-text-between-2-standard-texts-that-may-contain/m-p/113136#M29722</link>
      <description>&lt;P&gt;One of the reasons it did not work is you removed the field extractions from the regex string.  Please try again using the regex in my answer. &lt;/P&gt;</description>
      <pubDate>Fri, 10 Jul 2015 15:44:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-extract-text-between-2-standard-texts-that-may-contain/m-p/113136#M29722</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2015-07-10T15:44:01Z</dc:date>
    </item>
    <item>
      <title>Re: How can I extract text between 2 standard texts that may contain " . , ? / " ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-extract-text-between-2-standard-texts-that-may-contain/m-p/113137#M29723</link>
      <description>&lt;P&gt;I used this: (like before, I miss typed what I used!) &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;rex "IssuingBank:(?P.+).*?IssingCountry:(?P\w+) IRF: (?[ \w]+) CardProfile1:(?\w+) CardProfile2:(?P\w+)" | stats count by bank, issingcountry, IRF, cardProfile1
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And it did not work: No results found. Inspect ... ! &lt;/P&gt;</description>
      <pubDate>Fri, 10 Jul 2015 15:51:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-extract-text-between-2-standard-texts-that-may-contain/m-p/113137#M29723</guid>
      <dc:creator>kostasKats</dc:creator>
      <dc:date>2015-07-10T15:51:39Z</dc:date>
    </item>
    <item>
      <title>Re: How can I extract text between 2 standard texts that may contain " . , ? / " ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-extract-text-between-2-standard-texts-that-may-contain/m-p/113138#M29724</link>
      <description>&lt;P&gt;I still don't see the same regex as is in my answer.  Try removing the stats command to see if you're getting data extracted from the events.&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jul 2015 16:45:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-extract-text-between-2-standard-texts-that-may-contain/m-p/113138#M29724</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2015-07-10T16:45:09Z</dc:date>
    </item>
    <item>
      <title>Re: How can I extract text between 2 standard texts that may contain " . , ? / " ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-extract-text-between-2-standard-texts-that-may-contain/m-p/113139#M29725</link>
      <description>&lt;P&gt;Hello, &lt;/P&gt;

&lt;P&gt;I used exactly what you proposed without the stat command and it  seemed to work! But my initial purpose is to count them and export them into excel!&lt;/P&gt;

&lt;P&gt;Do you have any idea how can I count them?&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jul 2015 11:37:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-extract-text-between-2-standard-texts-that-may-contain/m-p/113139#M29725</guid>
      <dc:creator>kostasKats</dc:creator>
      <dc:date>2015-07-13T11:37:06Z</dc:date>
    </item>
    <item>
      <title>Re: How can I extract text between 2 standard texts that may contain " . , ? / " ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-extract-text-between-2-standard-texts-that-may-contain/m-p/113140#M29726</link>
      <description>&lt;P&gt;Try &lt;CODE&gt;... | stats count(_time) by bank, issingcountry, IRF, cardProfile1&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Jul 2015 02:30:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-extract-text-between-2-standard-texts-that-may-contain/m-p/113140#M29726</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2015-07-20T02:30:38Z</dc:date>
    </item>
    <item>
      <title>Re: How can I extract text between 2 standard texts that may contain " . , ? / " ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-extract-text-between-2-standard-texts-that-may-contain/m-p/113141#M29727</link>
      <description>&lt;P&gt;Unfortunately  it did not work. If I had to guess, I would say that the extracting method is not working. &lt;/P&gt;

&lt;P&gt;It should have worked as  it was: &lt;/P&gt;

&lt;P&gt;... | rex "IssuingBank:(?P.+).*?IssingCountry:(?P\w+) IRF: (?[ \w]+) CardProfile1:(?\w+) CardProfile2:(?P\w+)" | stats count by bank, issingcountry, IRF, cardProfile1&lt;/P&gt;</description>
      <pubDate>Mon, 20 Jul 2015 06:54:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-extract-text-between-2-standard-texts-that-may-contain/m-p/113141#M29727</guid>
      <dc:creator>kostasKats</dc:creator>
      <dc:date>2015-07-20T06:54:02Z</dc:date>
    </item>
    <item>
      <title>Re: How can I extract text between 2 standard texts that may contain " . , ? / " ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-extract-text-between-2-standard-texts-that-may-contain/m-p/113142#M29728</link>
      <description>&lt;P&gt;Didn't you say it worked without the stats command?  That should mean the extraction is working.&lt;/P&gt;</description>
      <pubDate>Mon, 20 Jul 2015 14:20:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-extract-text-between-2-standard-texts-that-may-contain/m-p/113142#M29728</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2015-07-20T14:20:59Z</dc:date>
    </item>
    <item>
      <title>Re: How can I extract text between 2 standard texts that may contain " . , ? / " ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-extract-text-between-2-standard-texts-that-may-contain/m-p/113143#M29729</link>
      <description>&lt;P&gt;I thought that it worked but since I can not use stats count it showed me that it didn't!&lt;/P&gt;</description>
      <pubDate>Mon, 20 Jul 2015 14:34:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-extract-text-between-2-standard-texts-that-may-contain/m-p/113143#M29729</guid>
      <dc:creator>kostasKats</dc:creator>
      <dc:date>2015-07-20T14:34:58Z</dc:date>
    </item>
    <item>
      <title>Re: How can I extract text between 2 standard texts that may contain " . , ? / " ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-extract-text-between-2-standard-texts-that-may-contain/m-p/113144#M29730</link>
      <description>&lt;P&gt;So what do you get?&lt;/P&gt;</description>
      <pubDate>Mon, 20 Jul 2015 18:28:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-extract-text-between-2-standard-texts-that-may-contain/m-p/113144#M29730</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2015-07-20T18:28:27Z</dc:date>
    </item>
    <item>
      <title>Re: How can I extract text between 2 standard texts that may contain " . , ? / " ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-extract-text-between-2-standard-texts-that-may-contain/m-p/113145#M29731</link>
      <description>&lt;P&gt;I am using this splunk version: 5.0.2, build 14956&lt;/P&gt;

&lt;P&gt;It comes empty!!  really appreciate your willingness to help out!&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jul 2015 06:52:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-extract-text-between-2-standard-texts-that-may-contain/m-p/113145#M29731</guid>
      <dc:creator>kostasKats</dc:creator>
      <dc:date>2015-07-21T06:52:04Z</dc:date>
    </item>
    <item>
      <title>Re: How can I extract text between 2 standard texts that may contain " . , ? / " ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-extract-text-between-2-standard-texts-that-may-contain/m-p/113146#M29732</link>
      <description>&lt;P&gt;If you run this query do you get any results?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | rex "IssuingBank:(?P&amp;lt;bank&amp;gt;.+).*?IssingCountry:(?P&amp;lt;issingcountry&amp;gt;\w+) IRF: (?&amp;lt;IRF&amp;gt;[ \w]+) CardProfile1:(?&amp;lt;cardProfile1&amp;gt;\w+) CardProfile2:(?P&amp;lt;cardProfile2&amp;gt;\w+)" | table bank issingCountry IRF cardProfile1 cardProfile2
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 21 Jul 2015 22:17:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-extract-text-between-2-standard-texts-that-may-contain/m-p/113146#M29732</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2015-07-21T22:17:23Z</dc:date>
    </item>
    <item>
      <title>Re: How can I extract text between 2 standard texts that may contain " . , ? / " ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-extract-text-between-2-standard-texts-that-may-contain/m-p/113147#M29733</link>
      <description>&lt;P&gt;Empty results again! &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt; &lt;/P&gt;

&lt;P&gt;&lt;A href="https://www.diigo.com/item/image/564dw/ytbe"&gt;https://www.diigo.com/item/image/564dw/ytbe&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jul 2015 08:29:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-extract-text-between-2-standard-texts-that-may-contain/m-p/113147#M29733</guid>
      <dc:creator>kostasKats</dc:creator>
      <dc:date>2015-07-22T08:29:59Z</dc:date>
    </item>
    <item>
      <title>Re: How can I extract text between 2 standard texts that may contain " . , ? / " ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-extract-text-between-2-standard-texts-that-may-contain/m-p/113148#M29734</link>
      <description>&lt;P&gt;I think there are two problems.&lt;BR /&gt;
First one is that in the field extract you give the field the name issingcountry but in the table you ask for the field issingCountry (note the capital C of country).&lt;BR /&gt;
Second one is that the regex doesn't match the problem is with the IRF field in the extract you place a space after "IRF:" but in the sample this space doesn't exist so there is no match.&lt;/P&gt;

&lt;P&gt;Also while you are editing the regex may I suggest you use this one:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;IssuingBank:(?P&amp;lt;bank&amp;gt;[^,]+).*?IssingCountry:(?P&amp;lt;issingCountry&amp;gt;\w+)\sIRF:(?&amp;lt;IRF&amp;gt;.+?)\sCardProfile1:(?&amp;lt;cardProfile1&amp;gt;\w+)\sCardProfile2:(?P&amp;lt;cardProfile2&amp;gt;\w+)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The regex above only needs 107 steps to match all the fields while the regex that you use needs 2769 steps to match, this means that you will have a faster search.&lt;BR /&gt;
(note: in the regex above I used a capital c in issingCountry)&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jul 2015 11:32:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-extract-text-between-2-standard-texts-that-may-contain/m-p/113148#M29734</guid>
      <dc:creator>aholzel</dc:creator>
      <dc:date>2015-07-22T11:32:08Z</dc:date>
    </item>
    <item>
      <title>Re: How can I extract text between 2 standard texts that may contain " . , ? / " ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-extract-text-between-2-standard-texts-that-may-contain/m-p/113149#M29735</link>
      <description>&lt;P&gt;Thank you very very much! This worked perfect!&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jul 2015 12:27:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-extract-text-between-2-standard-texts-that-may-contain/m-p/113149#M29735</guid>
      <dc:creator>kostasKats</dc:creator>
      <dc:date>2015-07-22T12:27:30Z</dc:date>
    </item>
    <item>
      <title>Re: How can I extract text between 2 standard texts that may contain " . , ? / " ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-extract-text-between-2-standard-texts-that-may-contain/m-p/113150#M29736</link>
      <description>&lt;P&gt;So you're getting matching events, but no results.  That means your data probably isn't matching the regex string.  Please verify the output of &lt;CODE&gt;flprd put/PAY&lt;/CODE&gt; matches your original post.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jul 2015 15:05:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-extract-text-between-2-standard-texts-that-may-contain/m-p/113150#M29736</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2015-07-22T15:05:00Z</dc:date>
    </item>
    <item>
      <title>Re: How can I extract text between 2 standard texts that may contain " . , ? / " ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-extract-text-between-2-standard-texts-that-may-contain/m-p/113151#M29737</link>
      <description>&lt;P&gt;Dear aholzel I want your help again with something else:&lt;/P&gt;

&lt;P&gt;Parameters: {"referrer"=&amp;gt;"&lt;A href="http://www.xxxxx.net/transport_deeplink/4.0/EE/en-gb/EUR"&gt;http://www.xxxxx.net/transport_deeplink/4.0/EE/en-gb/EUR&lt;/A&gt; &lt;/P&gt;

&lt;P&gt;I have this line and i want ot use a regex command (rex field=_raw) in order to count them by:&lt;/P&gt;

&lt;P&gt;domain: &lt;A href="http://www.xxxxx.net"&gt;http://www.xxxxx.net&lt;/A&gt;&lt;BR /&gt;
country: EE&lt;BR /&gt;
language: en-gb&lt;BR /&gt;
currency: EUR &lt;/P&gt;

&lt;P&gt;Can you please help me with this?&lt;/P&gt;</description>
      <pubDate>Wed, 05 Aug 2015 08:23:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-extract-text-between-2-standard-texts-that-may-contain/m-p/113151#M29737</guid>
      <dc:creator>kostasKats</dc:creator>
      <dc:date>2015-08-05T08:23:19Z</dc:date>
    </item>
  </channel>
</rss>

