<?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: Extraction: How to split the values and search for specific words? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Extraction-How-to-split-the-values-and-search-for-specific-words/m-p/428781#M122652</link>
    <description>&lt;P&gt;Hi @bollam,&lt;/P&gt;

&lt;P&gt;Try this run anywhere search..&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults a=1
| eval Information="details-dist-Hyderabad,details-state-Telangana,others-info-testing,details-local-abc,others-testing-info"
| append
[ makeresults a1=1
|eval Information="details-state-Karnataka,details-dist-Bangalore,others-info-testing,others-testing-info,details-local-xyz"
]
|rex max_match=0 field=Information "details-dist-(?P\w+)"
|rex max_match=0 field=Information "details-state-(?P\w+)"
|rex max_match=0 field=Information "details-local-(?P\w+)"
|eval newField="details-dist-".dist.",details-state-".state.",details-local-".local
|fields - dist,local,state
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 28 Aug 2018 17:50:16 GMT</pubDate>
    <dc:creator>nadlurinadluri</dc:creator>
    <dc:date>2018-08-28T17:50:16Z</dc:date>
    <item>
      <title>Extraction: How to split the values and search for specific words?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extraction-How-to-split-the-values-and-search-for-specific-words/m-p/428780#M122651</link>
      <description>&lt;P&gt;Hello,&lt;BR /&gt;
I have got a few events with the fields "Information" and "Name". Few events look like below, and I have many such events.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;25/08/2018  Information="details-dist-Hyderabad,details-state-Telangana,others-info-testing,details-local-abc,others-testing-info" , Name="abc"
26/08/2018  Information="details-state-Karnataka,details-dist-Bangalore,others-info-testing,others-testing-info,details-local-xyz" , Name="xyz"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The values of the fields are not consistent and it might shuffle the position. &lt;BR /&gt;
For an instance, The details-dist-Hyderabad in the first event is at position 1 but in the second event it is in the position 2.&lt;/P&gt;

&lt;P&gt;I would like to extract the values which contain "details" to a new field and should be placed in a order. So I can use this field for the further extraction.&lt;/P&gt;

&lt;P&gt;Output should look like below.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;newField = "details-dist-Hyderabad,details-state-Telangana,details-local-abc"
newField = "details-dist-Bangalore,details-state-Karnataka,details-local-xyz"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 28 Aug 2018 16:47:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extraction-How-to-split-the-values-and-search-for-specific-words/m-p/428780#M122651</guid>
      <dc:creator>bollam</dc:creator>
      <dc:date>2018-08-28T16:47:13Z</dc:date>
    </item>
    <item>
      <title>Re: Extraction: How to split the values and search for specific words?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extraction-How-to-split-the-values-and-search-for-specific-words/m-p/428781#M122652</link>
      <description>&lt;P&gt;Hi @bollam,&lt;/P&gt;

&lt;P&gt;Try this run anywhere search..&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults a=1
| eval Information="details-dist-Hyderabad,details-state-Telangana,others-info-testing,details-local-abc,others-testing-info"
| append
[ makeresults a1=1
|eval Information="details-state-Karnataka,details-dist-Bangalore,others-info-testing,others-testing-info,details-local-xyz"
]
|rex max_match=0 field=Information "details-dist-(?P\w+)"
|rex max_match=0 field=Information "details-state-(?P\w+)"
|rex max_match=0 field=Information "details-local-(?P\w+)"
|eval newField="details-dist-".dist.",details-state-".state.",details-local-".local
|fields - dist,local,state
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 28 Aug 2018 17:50:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extraction-How-to-split-the-values-and-search-for-specific-words/m-p/428781#M122652</guid>
      <dc:creator>nadlurinadluri</dc:creator>
      <dc:date>2018-08-28T17:50:16Z</dc:date>
    </item>
    <item>
      <title>Re: Extraction: How to split the values and search for specific words?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extraction-How-to-split-the-values-and-search-for-specific-words/m-p/428782#M122653</link>
      <description>&lt;P&gt;@nadlurinadluri, It worked, Thanks for the quick help!!&lt;/P&gt;</description>
      <pubDate>Wed, 29 Aug 2018 06:42:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extraction-How-to-split-the-values-and-search-for-specific-words/m-p/428782#M122653</guid>
      <dc:creator>bollam</dc:creator>
      <dc:date>2018-08-29T06:42:34Z</dc:date>
    </item>
    <item>
      <title>Re: Extraction: How to split the values and search for specific words?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extraction-How-to-split-the-values-and-search-for-specific-words/m-p/428783#M122654</link>
      <description>&lt;P&gt;Glad that it helped you &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; Happy Splunking!! &lt;/P&gt;</description>
      <pubDate>Wed, 29 Aug 2018 17:06:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extraction-How-to-split-the-values-and-search-for-specific-words/m-p/428783#M122654</guid>
      <dc:creator>nadlurinadluri</dc:creator>
      <dc:date>2018-08-29T17:06:56Z</dc:date>
    </item>
  </channel>
</rss>

