<?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 Breaking of one field values into 2-3 different fields in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Breaking-of-one-field-values-into-2-3-different-fields/m-p/464127#M191558</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I have a field called Location and It have data like Call Type, Site, Wing and Room all in just one field called Location. I want to break it down and separate Call Type, Wing and Room as 3 separate fields so that I can achieve filters on a dashboard.&lt;/P&gt;

&lt;P&gt;Please let me know if that's achievable.&lt;/P&gt;

&lt;P&gt;Thanks,&lt;/P&gt;</description>
    <pubDate>Tue, 22 Oct 2019 00:19:25 GMT</pubDate>
    <dc:creator>mohammedk01</dc:creator>
    <dc:date>2019-10-22T00:19:25Z</dc:date>
    <item>
      <title>Breaking of one field values into 2-3 different fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Breaking-of-one-field-values-into-2-3-different-fields/m-p/464127#M191558</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I have a field called Location and It have data like Call Type, Site, Wing and Room all in just one field called Location. I want to break it down and separate Call Type, Wing and Room as 3 separate fields so that I can achieve filters on a dashboard.&lt;/P&gt;

&lt;P&gt;Please let me know if that's achievable.&lt;/P&gt;

&lt;P&gt;Thanks,&lt;/P&gt;</description>
      <pubDate>Tue, 22 Oct 2019 00:19:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Breaking-of-one-field-values-into-2-3-different-fields/m-p/464127#M191558</guid>
      <dc:creator>mohammedk01</dc:creator>
      <dc:date>2019-10-22T00:19:25Z</dc:date>
    </item>
    <item>
      <title>Re: Breaking of one field values into 2-3 different fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Breaking-of-one-field-values-into-2-3-different-fields/m-p/464128#M191559</link>
      <description>&lt;P&gt;You should probably provide an example with delimiters, but you can do this with regex if nothing else.&lt;/P&gt;</description>
      <pubDate>Tue, 22 Oct 2019 00:46:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Breaking-of-one-field-values-into-2-3-different-fields/m-p/464128#M191559</guid>
      <dc:creator>anthonymelita</dc:creator>
      <dc:date>2019-10-22T00:46:25Z</dc:date>
    </item>
    <item>
      <title>Re: Breaking of one field values into 2-3 different fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Breaking-of-one-field-values-into-2-3-different-fields/m-p/464129#M191560</link>
      <description>&lt;P&gt;Hi Anthony,&lt;/P&gt;

&lt;P&gt;I have like two fields namely LOC_ID(Location Id) and LABEL(Location Description) so,&lt;/P&gt;

&lt;P&gt;LOC_ID                                                 LABEL&lt;BR /&gt;
0000000100020003                          Australia NSW Sydney Strathfield&lt;/P&gt;

&lt;P&gt;so as you can see LOC_ID has like 16 digits and each 4 defines a value for example the first 4 0000 defines Country, the next 4 0001 States and so on.&lt;/P&gt;

&lt;P&gt;I want to break LABEL field and get 3 new fields separately as State, Region and Suburb like so that I can add 3 filters on my dashboard such as State Region and suburb&lt;/P&gt;</description>
      <pubDate>Tue, 22 Oct 2019 00:59:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Breaking-of-one-field-values-into-2-3-different-fields/m-p/464129#M191560</guid>
      <dc:creator>mohammedk01</dc:creator>
      <dc:date>2019-10-22T00:59:49Z</dc:date>
    </item>
    <item>
      <title>Re: Breaking of one field values into 2-3 different fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Breaking-of-one-field-values-into-2-3-different-fields/m-p/464130#M191561</link>
      <description>&lt;P&gt;I don't fully grasp which of the 4 values in label should go into which of the 3 buckets, but for LOC_ID you can use &lt;CODE&gt;rex&lt;/CODE&gt; like anthony suggested or used &lt;CODE&gt;substr&lt;/CODE&gt; if you know that it's always 16 digits &lt;A href="https://docs.splunk.com/Documentation/Splunk/7.3.2/SearchReference/TextFunctions#substr.28X.2CY.2CZ.29"&gt;https://docs.splunk.com/Documentation/Splunk/7.3.2/SearchReference/TextFunctions#substr.28X.2CY.2CZ.29&lt;/A&gt;.&lt;/P&gt;

&lt;P&gt;The syntax is as follows:&lt;BR /&gt;
&lt;CODE&gt;|eval Country=substr(LOC_ID, 1, 4)&lt;/CODE&gt; and this would take the first 4 digits of LOC_ID and create a new field called Country. You can do this for the other 3 as well. I like substr because it gives you a lot of string flexibility without the complexity of regex.&lt;/P&gt;

&lt;P&gt;If you clarify the LABEL question I had I might be able to help there as well. &lt;/P&gt;</description>
      <pubDate>Fri, 25 Oct 2019 21:27:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Breaking-of-one-field-values-into-2-3-different-fields/m-p/464130#M191561</guid>
      <dc:creator>aberkow</dc:creator>
      <dc:date>2019-10-25T21:27:17Z</dc:date>
    </item>
    <item>
      <title>Re: Breaking of one field values into 2-3 different fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Breaking-of-one-field-values-into-2-3-different-fields/m-p/464131#M191562</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;| stats count
| eval _raw="LOC_ID,LABEL
0000000100020003,Australia NSW Sydney Strathfield"
| multikv forceheader=1
| mvexpand _raw
| table LOC_ID LABEL
`comment("this is sample data")`
| rex field=LOC_ID "(?&amp;lt;Area_code&amp;gt;\d{4})(?&amp;lt;Country_code&amp;gt;\d{4})(?&amp;lt;States_code&amp;gt;\d{4})"
| rex field=LABEL "(?&amp;lt;Country&amp;gt;[^ ]+) (?&amp;lt;State&amp;gt;[^ ]+) (?&amp;lt;Region&amp;gt;[^ ]+) (?&amp;lt;Suburb&amp;gt;[^ ]+)"
| table LOC_ID Area_code Country_code States_code LABEL Country State Region Suburb
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Hi, all. this is sample query.&lt;BR /&gt;
How about this?&lt;BR /&gt;
I divided it into four according to the example sentence.&lt;BR /&gt;
Wasn't it divided into three?&lt;/P&gt;

&lt;P&gt;@aberkow , I'm sorry to  break into a conversation. &lt;/P&gt;</description>
      <pubDate>Fri, 25 Oct 2019 21:42:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Breaking-of-one-field-values-into-2-3-different-fields/m-p/464131#M191562</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2019-10-25T21:42:34Z</dc:date>
    </item>
  </channel>
</rss>

