<?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 split up a sentence string into multiple words in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-split-up-a-sentence-string-into-multiple-words/m-p/495743#M84530</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;You could try this as well.&lt;BR /&gt;
Please test and let us know.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval userData="Split this string"
|table userData
|eval words=split(userData," ")
|eval userData1=mvindex(words,0),userData2=mvindex(words,1),userData3=mvindex(words,2)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 02 Dec 2019 22:05:36 GMT</pubDate>
    <dc:creator>dindu</dc:creator>
    <dc:date>2019-12-02T22:05:36Z</dc:date>
    <item>
      <title>How split up a sentence string into multiple words</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-split-up-a-sentence-string-into-multiple-words/m-p/495740#M84527</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;
let's say there is a field like this:&lt;BR /&gt;
userData= Split this string&lt;/P&gt;

&lt;P&gt;Is it possible to extract this sentence into different fields?&lt;BR /&gt;
userData1=split&lt;BR /&gt;
userData2=this&lt;BR /&gt;
userData3=string&lt;/P&gt;</description>
      <pubDate>Mon, 02 Dec 2019 18:00:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-split-up-a-sentence-string-into-multiple-words/m-p/495740#M84527</guid>
      <dc:creator>ibowman1995</dc:creator>
      <dc:date>2019-12-02T18:00:01Z</dc:date>
    </item>
    <item>
      <title>Re: How split up a sentence string into multiple words</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-split-up-a-sentence-string-into-multiple-words/m-p/495741#M84528</link>
      <description>&lt;P&gt;Yes, it's possible.  Look in the search docs for &lt;CODE&gt;split&lt;/CODE&gt;.  It returns a multi-value field with the words from the original string.  Use &lt;CODE&gt;mvindex()&lt;/CODE&gt; to access them.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | eval words = split(userData, " ") 
| eval userData1=mvindex(userData, 0), userData2=mvindex(userData,1), userData3=mvindex(userData, 2)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 02 Dec 2019 18:47:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-split-up-a-sentence-string-into-multiple-words/m-p/495741#M84528</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2019-12-02T18:47:21Z</dc:date>
    </item>
    <item>
      <title>Re: How split up a sentence string into multiple words</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-split-up-a-sentence-string-into-multiple-words/m-p/495742#M84529</link>
      <description>&lt;P&gt;Hi, @ibowman1995&lt;BR /&gt;
Yes, you can. try this.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval userData="Split this string"
| rex field=userData "(?&amp;lt;userData1&amp;gt;[^ ]+) (?&amp;lt;userData2&amp;gt;[^ ]+) (?&amp;lt;userData3&amp;gt;[^ ]+)"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 02 Dec 2019 18:55:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-split-up-a-sentence-string-into-multiple-words/m-p/495742#M84529</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2019-12-02T18:55:06Z</dc:date>
    </item>
    <item>
      <title>Re: How split up a sentence string into multiple words</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-split-up-a-sentence-string-into-multiple-words/m-p/495743#M84530</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;You could try this as well.&lt;BR /&gt;
Please test and let us know.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval userData="Split this string"
|table userData
|eval words=split(userData," ")
|eval userData1=mvindex(words,0),userData2=mvindex(words,1),userData3=mvindex(words,2)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 02 Dec 2019 22:05:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-split-up-a-sentence-string-into-multiple-words/m-p/495743#M84530</guid>
      <dc:creator>dindu</dc:creator>
      <dc:date>2019-12-02T22:05:36Z</dc:date>
    </item>
    <item>
      <title>Re: How split up a sentence string into multiple words</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-split-up-a-sentence-string-into-multiple-words/m-p/495744#M84531</link>
      <description>&lt;P&gt;i can confirm this works bc i had multiple fields in one string. &lt;/P&gt;</description>
      <pubDate>Fri, 07 Feb 2020 17:01:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-split-up-a-sentence-string-into-multiple-words/m-p/495744#M84531</guid>
      <dc:creator>jacono64</dc:creator>
      <dc:date>2020-02-07T17:01:31Z</dc:date>
    </item>
  </channel>
</rss>

