<?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: Extract multiple values from a single field into multiple unique fields in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Extract-multiple-values-from-a-single-field-into-multiple-unique/m-p/467221#M191879</link>
    <description>&lt;P&gt;Hey @alex387, just following up to see if you got the answer you need.&lt;/P&gt;</description>
    <pubDate>Fri, 13 Sep 2019 20:42:16 GMT</pubDate>
    <dc:creator>thesplunkmonkey</dc:creator>
    <dc:date>2019-09-13T20:42:16Z</dc:date>
    <item>
      <title>Extract multiple values from a single field into multiple unique fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extract-multiple-values-from-a-single-field-into-multiple-unique/m-p/467217#M191875</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;Is there a way to split out the unique values of a field into separate fields that are returned after a search?&lt;/P&gt;

&lt;P&gt;For example, my search returns the following syslog messages&lt;BR /&gt;
Login Success from 1.1.1.1&lt;BR /&gt;
Login Failed from 2.2.2.2&lt;BR /&gt;
Login Failed from 1.1.1.1&lt;/P&gt;

&lt;P&gt;Splunk has extracted the following field "field 1" which contains the "Success" and "Failed" string values&lt;/P&gt;

&lt;P&gt;Is there a way (preferably eval command)  to extract these values into there own unique fields, i.e field2=Failed, field3=Success&lt;/P&gt;

&lt;P&gt;This is so I can use a table command like the following&lt;BR /&gt;
| table ip, field1, field2, field3&lt;/P&gt;

&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Tue, 03 Sep 2019 00:14:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extract-multiple-values-from-a-single-field-into-multiple-unique/m-p/467217#M191875</guid>
      <dc:creator>alex387</dc:creator>
      <dc:date>2019-09-03T00:14:11Z</dc:date>
    </item>
    <item>
      <title>Re: Extract multiple values from a single field into multiple unique fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extract-multiple-values-from-a-single-field-into-multiple-unique/m-p/467218#M191876</link>
      <description>&lt;P&gt;why would you want that?&lt;BR /&gt;
the entire idea is to be able to put different values in fields so you can perform functions and statistics on them&lt;BR /&gt;
a single value to a field is almost meaningless ...&lt;BR /&gt;
you can always do your query with table, but i think you probably have a question regarding your data ...&lt;BR /&gt;
think about this / those question/s articulate them, and write the query that will answer it.&lt;BR /&gt;
also, i recommend to read at docs.splunk.com regarding fields, extractions, and data on-boarding&lt;/P&gt;</description>
      <pubDate>Tue, 03 Sep 2019 03:47:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extract-multiple-values-from-a-single-field-into-multiple-unique/m-p/467218#M191876</guid>
      <dc:creator>adonio</dc:creator>
      <dc:date>2019-09-03T03:47:23Z</dc:date>
    </item>
    <item>
      <title>Re: Extract multiple values from a single field into multiple unique fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extract-multiple-values-from-a-single-field-into-multiple-unique/m-p/467219#M191877</link>
      <description>&lt;P&gt;There's other ways to do this, but here's one possibility for you --&lt;/P&gt;

&lt;P&gt;Based on your sample data, it seems you would know the possible values ahead of time.  If that's the case, you could use an eval to assign the value to a field you want.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | eval field2=if(field1 == "Failed", field1, "") | eval field3=if(field1 == "Success", field1, "") | table ip field2 field3
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This would give you the following, given the data you provided.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;ip            field2       field3
1.1.1.1                    Success
2.2.2.2       Failed
1.1.1.1       Failed
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 03 Sep 2019 16:24:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extract-multiple-values-from-a-single-field-into-multiple-unique/m-p/467219#M191877</guid>
      <dc:creator>thesplunkmonkey</dc:creator>
      <dc:date>2019-09-03T16:24:20Z</dc:date>
    </item>
    <item>
      <title>Re: Extract multiple values from a single field into multiple unique fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extract-multiple-values-from-a-single-field-into-multiple-unique/m-p/467220#M191878</link>
      <description>&lt;P&gt;I agree with @adonio about this request not making a lot of sense.  However, here's one way to do it.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | eval field2 = if(field1=="Success", field1, NULL), field3 = if(field1=="Failed", field1, NULL)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 03 Sep 2019 19:30:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extract-multiple-values-from-a-single-field-into-multiple-unique/m-p/467220#M191878</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2019-09-03T19:30:19Z</dc:date>
    </item>
    <item>
      <title>Re: Extract multiple values from a single field into multiple unique fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extract-multiple-values-from-a-single-field-into-multiple-unique/m-p/467221#M191879</link>
      <description>&lt;P&gt;Hey @alex387, just following up to see if you got the answer you need.&lt;/P&gt;</description>
      <pubDate>Fri, 13 Sep 2019 20:42:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extract-multiple-values-from-a-single-field-into-multiple-unique/m-p/467221#M191879</guid>
      <dc:creator>thesplunkmonkey</dc:creator>
      <dc:date>2019-09-13T20:42:16Z</dc:date>
    </item>
  </channel>
</rss>

