<?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 to write a Regex to extract and list out the country names from my html formatted results ? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-Regex-to-extract-and-list-out-the-country-names/m-p/266723#M80198</link>
    <description>&lt;P&gt;Please use the code options while pasting the answer so that the page should not exclude characters such as "&amp;lt; "etc.. &lt;/P&gt;</description>
    <pubDate>Thu, 08 Oct 2015 10:22:04 GMT</pubDate>
    <dc:creator>badrinath_itrs</dc:creator>
    <dc:date>2015-10-08T10:22:04Z</dc:date>
    <item>
      <title>How to write a Regex to extract and list out the country names from my html formatted results ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-Regex-to-extract-and-list-out-the-country-names/m-p/266720#M80195</link>
      <description>&lt;P&gt;The following were my html search results&lt;/P&gt;

&lt;P&gt;&amp;lt;country&amp;gt;USA&amp;lt;/country&amp;gt;&lt;BR /&gt;
&amp;lt;country&amp;gt;CANADA&amp;lt;/country&amp;gt;&lt;BR /&gt;
&amp;lt;country&amp;gt;UK&amp;lt;/country&amp;gt;&lt;BR /&gt;
&amp;lt;country&amp;gt;AUSTRALIA&amp;lt;/country&amp;gt;&lt;/P&gt;

&lt;P&gt;How do I write the regex to extract and list out the countries and their count.&lt;/P&gt;

&lt;P&gt;Thanks &lt;/P&gt;</description>
      <pubDate>Thu, 08 Oct 2015 03:48:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-Regex-to-extract-and-list-out-the-country-names/m-p/266720#M80195</guid>
      <dc:creator>pavanae</dc:creator>
      <dc:date>2015-10-08T03:48:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to write a Regex to extract and list out the country names from my html formatted results ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-Regex-to-extract-and-list-out-the-country-names/m-p/266721#M80196</link>
      <description>&lt;P&gt;Is every line a seperated event, or are all lines united in one event?&lt;/P&gt;</description>
      <pubDate>Thu, 08 Oct 2015 08:10:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-Regex-to-extract-and-list-out-the-country-names/m-p/266721#M80196</guid>
      <dc:creator>tom_frotscher</dc:creator>
      <dc:date>2015-10-08T08:10:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to write a Regex to extract and list out the country names from my html formatted results ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-Regex-to-extract-and-list-out-the-country-names/m-p/266722#M80197</link>
      <description>&lt;P&gt;First, if the search results you mentioned are separate events, then you are good. Else, you need to add this config in the Parsing Stage (Heavy Forwarder/Indexer):&lt;/P&gt;

&lt;P&gt;props.conf:&lt;BR /&gt;
SHOULD_LINEMERGE=false&lt;/P&gt;

&lt;P&gt;Post that, use this regex in the search query to extract the Amount Due field and then calculate the average.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;...Initial Search...&amp;gt;|rex field=_raw "&amp;lt;country&amp;gt;(?&amp;lt; COUNTRY&amp;gt;.*)&amp;lt;\/country&amp;gt;"|stats count by COUNTRY as COUNTRY_COUNT
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 08 Oct 2015 09:45:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-Regex-to-extract-and-list-out-the-country-names/m-p/266722#M80197</guid>
      <dc:creator>ishaanshekhar</dc:creator>
      <dc:date>2015-10-08T09:45:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to write a Regex to extract and list out the country names from my html formatted results ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-Regex-to-extract-and-list-out-the-country-names/m-p/266723#M80198</link>
      <description>&lt;P&gt;Please use the code options while pasting the answer so that the page should not exclude characters such as "&amp;lt; "etc.. &lt;/P&gt;</description>
      <pubDate>Thu, 08 Oct 2015 10:22:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-Regex-to-extract-and-list-out-the-country-names/m-p/266723#M80198</guid>
      <dc:creator>badrinath_itrs</dc:creator>
      <dc:date>2015-10-08T10:22:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to write a Regex to extract and list out the country names from my html formatted results ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-Regex-to-extract-and-list-out-the-country-names/m-p/266724#M80199</link>
      <description>&lt;P&gt;thanks badrinath! I edited my answer and now it is working fine.&lt;/P&gt;</description>
      <pubDate>Thu, 08 Oct 2015 11:46:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-Regex-to-extract-and-list-out-the-country-names/m-p/266724#M80199</guid>
      <dc:creator>ishaanshekhar</dc:creator>
      <dc:date>2015-10-08T11:46:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to write a Regex to extract and list out the country names from my html formatted results ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-Regex-to-extract-and-list-out-the-country-names/m-p/266725#M80200</link>
      <description>&lt;P&gt;Assuming those are all in the same event...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rex max_match=0 "\&amp;lt;country\&amp;gt;(?&amp;lt;country&amp;gt;[^\&amp;lt;]+)"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Reference: &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.3.0/SearchReference/rex"&gt;http://docs.splunk.com/Documentation/Splunk/6.3.0/SearchReference/rex&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Oct 2015 18:22:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-write-a-Regex-to-extract-and-list-out-the-country-names/m-p/266725#M80200</guid>
      <dc:creator>masonmorales</dc:creator>
      <dc:date>2015-10-08T18:22:48Z</dc:date>
    </item>
  </channel>
</rss>

