<?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: Search comma surrounded phrase in _raw using rex in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Search-comma-surrounded-phrase-in-raw-using-rex/m-p/478328#M134162</link>
    <description>&lt;P&gt;This may help.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | rex "en,(?&amp;lt;country&amp;gt;\w+)"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 09 Sep 2019 12:12:00 GMT</pubDate>
    <dc:creator>richgalloway</dc:creator>
    <dc:date>2019-09-09T12:12:00Z</dc:date>
    <item>
      <title>Search comma surrounded phrase in _raw using rex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-comma-surrounded-phrase-in-raw-using-rex/m-p/478326#M134160</link>
      <description>&lt;P&gt;In the logged data:&lt;/P&gt;

&lt;P&gt;....,en,us,....(one record)&lt;BR /&gt;
....,en,in,.....(another record)&lt;BR /&gt;
(Here .... represents string data)&lt;/P&gt;

&lt;P&gt;I need to extract 'us' and 'in' from _raw from each log.&lt;BR /&gt;
rex field = _raw "(?:us?[^,]+)"&lt;/P&gt;

&lt;P&gt;This is erroneous but it will be great if someone can help out.&lt;/P&gt;</description>
      <pubDate>Mon, 09 Sep 2019 06:26:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-comma-surrounded-phrase-in-raw-using-rex/m-p/478326#M134160</guid>
      <dc:creator>sai_shreyashi_p</dc:creator>
      <dc:date>2019-09-09T06:26:10Z</dc:date>
    </item>
    <item>
      <title>Re: Search comma surrounded phrase in _raw using rex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-comma-surrounded-phrase-in-raw-using-rex/m-p/478327#M134161</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;If you provide full sample raw data then community member will able to help on regex side.&lt;/P&gt;</description>
      <pubDate>Mon, 09 Sep 2019 11:58:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-comma-surrounded-phrase-in-raw-using-rex/m-p/478327#M134161</guid>
      <dc:creator>harsmarvania57</dc:creator>
      <dc:date>2019-09-09T11:58:10Z</dc:date>
    </item>
    <item>
      <title>Re: Search comma surrounded phrase in _raw using rex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-comma-surrounded-phrase-in-raw-using-rex/m-p/478328#M134162</link>
      <description>&lt;P&gt;This may help.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | rex "en,(?&amp;lt;country&amp;gt;\w+)"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 09 Sep 2019 12:12:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-comma-surrounded-phrase-in-raw-using-rex/m-p/478328#M134162</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2019-09-09T12:12:00Z</dc:date>
    </item>
    <item>
      <title>Re: Search comma surrounded phrase in _raw using rex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-comma-surrounded-phrase-in-raw-using-rex/m-p/478329#M134163</link>
      <description>&lt;P&gt;actually in the data it isn't necessary for the country to be preceded by 'en' which is why I was facing issues. &lt;BR /&gt;
Is there any way to look for strings like ",us," or ",jp,"? Regex or rex expression for looking in _raw?&lt;/P&gt;</description>
      <pubDate>Tue, 10 Sep 2019 07:09:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-comma-surrounded-phrase-in-raw-using-rex/m-p/478329#M134163</guid>
      <dc:creator>sai_shreyashi_p</dc:creator>
      <dc:date>2019-09-10T07:09:39Z</dc:date>
    </item>
    <item>
      <title>Re: Search comma surrounded phrase in _raw using rex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-comma-surrounded-phrase-in-raw-using-rex/m-p/478330#M134164</link>
      <description>&lt;P&gt;Sorry for the vague description of data but actually this data cannot be exposed. &lt;BR /&gt;
They are mainly comma separated values in the middle of which we have language code,country code.&lt;BR /&gt;
They are somewhere in the middle of _raw.&lt;BR /&gt;
Ex: 324724588,nhiden-niuen-jkjl,&lt;STRONG&gt;en,us&lt;/STRONG&gt;,6484-47934......,...&lt;/P&gt;</description>
      <pubDate>Tue, 10 Sep 2019 07:12:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-comma-surrounded-phrase-in-raw-using-rex/m-p/478330#M134164</guid>
      <dc:creator>sai_shreyashi_p</dc:creator>
      <dc:date>2019-09-10T07:12:24Z</dc:date>
    </item>
    <item>
      <title>Re: Search comma surrounded phrase in _raw using rex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-comma-surrounded-phrase-in-raw-using-rex/m-p/478331#M134165</link>
      <description>&lt;P&gt;If the sample data above is accurate then this should work:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | rex ",(?&amp;lt;lang&amp;gt;\w+),(?&amp;lt;country&amp;gt;\w+)"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 10 Sep 2019 12:58:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-comma-surrounded-phrase-in-raw-using-rex/m-p/478331#M134165</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2019-09-10T12:58:20Z</dc:date>
    </item>
  </channel>
</rss>

