<?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 to extract certain words and exclude words from string? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-certain-words-and-exclude-words-from-string/m-p/649776#M224657</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/258089"&gt;@marinella26&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;I suppose that the words to extract are in a field, so you can use the rex command to extract the word in each field, something like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;your_Search&amp;gt;
| rex field=your_field "^(?&amp;lt;word&amp;gt;[A-Za-z]*)"
| table word&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
    <pubDate>Mon, 10 Jul 2023 06:23:05 GMT</pubDate>
    <dc:creator>gcusello</dc:creator>
    <dc:date>2023-07-10T06:23:05Z</dc:date>
    <item>
      <title>How to extract certain words and exclude words from string?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-certain-words-and-exclude-words-from-string/m-p/649772#M224655</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I want to extract certain words only and exclude that comes after numbers.&lt;/P&gt;&lt;P&gt;ex.&lt;BR /&gt;Apple12ed&lt;BR /&gt;Apple456ppp&lt;BR /&gt;Orange234iw&lt;BR /&gt;Banana7ye&lt;/P&gt;&lt;P&gt;expected result:&lt;BR /&gt;Apple&amp;nbsp;&lt;BR /&gt;Orange&amp;nbsp;&lt;BR /&gt;Banana&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried below, but the each string has different numbers and words, so the result is not correct.&lt;/P&gt;&lt;P&gt;| eval Fruits = substr(Fruits, 1, len(Fruits)-4)&lt;/P&gt;&lt;P&gt;incorrect Result:&lt;BR /&gt;Apple&lt;BR /&gt;Apple45&lt;BR /&gt;Orange2&lt;BR /&gt;Banan&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Thanks in advance.&lt;/P&gt;</description>
      <pubDate>Mon, 10 Jul 2023 06:05:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-certain-words-and-exclude-words-from-string/m-p/649772#M224655</guid>
      <dc:creator>marinella26</dc:creator>
      <dc:date>2023-07-10T06:05:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract certain words and exclude words from string?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-certain-words-and-exclude-words-from-string/m-p/649774#M224656</link>
      <description>&lt;P&gt;There are more than 100 strings, so it is not ideal to use &amp;lt;eval&amp;gt; to create each strings.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Jul 2023 06:10:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-certain-words-and-exclude-words-from-string/m-p/649774#M224656</guid>
      <dc:creator>marinella26</dc:creator>
      <dc:date>2023-07-10T06:10:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract certain words and exclude words from string?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-certain-words-and-exclude-words-from-string/m-p/649776#M224657</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/258089"&gt;@marinella26&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;I suppose that the words to extract are in a field, so you can use the rex command to extract the word in each field, something like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;your_Search&amp;gt;
| rex field=your_field "^(?&amp;lt;word&amp;gt;[A-Za-z]*)"
| table word&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Mon, 10 Jul 2023 06:23:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-certain-words-and-exclude-words-from-string/m-p/649776#M224657</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2023-07-10T06:23:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract certain words and exclude words from string?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-certain-words-and-exclude-words-from-string/m-p/649925#M224701</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/161352"&gt;@gcusello&lt;/a&gt;&amp;nbsp;It worked!! Thank you so much.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jul 2023 06:38:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-certain-words-and-exclude-words-from-string/m-p/649925#M224701</guid>
      <dc:creator>marinella26</dc:creator>
      <dc:date>2023-07-11T06:38:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract certain words and exclude words from string?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-certain-words-and-exclude-words-from-string/m-p/649927#M224702</link>
      <description>&lt;P&gt;Maybe using&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;^(?P&amp;lt;word&amp;gt;[a-zA-Z]+)(?=\d)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;would be more exact, as it does not return an empty match on strings that do not start with a letter such as "_Apple". Furthermore, it makes sure the word is followed by a digit and does not match "Apple_" for example.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jul 2023 06:52:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-certain-words-and-exclude-words-from-string/m-p/649927#M224702</guid>
      <dc:creator>duesser</dc:creator>
      <dc:date>2023-07-11T06:52:56Z</dc:date>
    </item>
  </channel>
</rss>

