<?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 words and digits from a particular field in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-words-and-digits-from-a-particular-field/m-p/483550#M135378</link>
    <description>&lt;P&gt;Wow awesome code, it didn't quite give me the result I wanted but it does have some other use-cases. &lt;BR /&gt;
Perhaps a little simplistic, but this is what work for me &lt;BR /&gt;
sourcetype=some_sourcetype |mvexpand SAMU| search SAMU="SAMM*" " #20*" "-*"&lt;/P&gt;</description>
    <pubDate>Wed, 30 Sep 2020 03:03:32 GMT</pubDate>
    <dc:creator>majek81</dc:creator>
    <dc:date>2020-09-30T03:03:32Z</dc:date>
    <item>
      <title>How to extract words and digits from a particular field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-words-and-digits-from-a-particular-field/m-p/483548#M135376</link>
      <description>&lt;P&gt;Hello everyone,&lt;/P&gt;

&lt;P&gt;I am trying to extract strings containing  &lt;CODE&gt;SAMM #2222-A-1111&lt;/CODE&gt; from other strings in a field named  &lt;CODE&gt;SAMU&lt;/CODE&gt; .&lt;BR /&gt;
This is what I  have entered:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;SAMU="SAMM*" "#2*" "-*" 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;It works but also output other strings that I don't want to see. &lt;BR /&gt;
Any suggestions? &lt;/P&gt;</description>
      <pubDate>Thu, 14 Nov 2019 17:26:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-words-and-digits-from-a-particular-field/m-p/483548#M135376</guid>
      <dc:creator>majek81</dc:creator>
      <dc:date>2019-11-14T17:26:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract words and digits from a particular field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-words-and-digits-from-a-particular-field/m-p/483549#M135377</link>
      <description>&lt;P&gt;I have two thoughts: &lt;/P&gt;

&lt;P&gt;1) You can try double searching on SAMU, like so:&lt;BR /&gt;
&lt;CODE&gt;SAMU="SAMM*" SAMU="*#2222-A-1111*"&lt;/CODE&gt; (not the best)&lt;/P&gt;

&lt;P&gt;2) Use regex:&lt;BR /&gt;
&lt;CODE&gt;| makeresults count=3&lt;BR /&gt;
| streamstats count&lt;BR /&gt;
| eval fieldToAlertOn=case(count=1, "potato SAMM potato potato #2222-A-1111 potato", count=2, "SAMM #3333-A-1111", count=3, "potato SAM potato #2222")&lt;BR /&gt;
| regex fieldToAlertOn=".*(?SAMM).*(?\#2222-A-1111).*"&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;If you run this you can see that only the row with both of those values sticks around. Also not the cleanest solution, but you can be more selective with what you're allowing if you're more familiar with regex (changing specific numbers to number characters, etc).&lt;/P&gt;</description>
      <pubDate>Fri, 15 Nov 2019 00:55:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-words-and-digits-from-a-particular-field/m-p/483549#M135377</guid>
      <dc:creator>aberkow</dc:creator>
      <dc:date>2019-11-15T00:55:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract words and digits from a particular field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-words-and-digits-from-a-particular-field/m-p/483550#M135378</link>
      <description>&lt;P&gt;Wow awesome code, it didn't quite give me the result I wanted but it does have some other use-cases. &lt;BR /&gt;
Perhaps a little simplistic, but this is what work for me &lt;BR /&gt;
sourcetype=some_sourcetype |mvexpand SAMU| search SAMU="SAMM*" " #20*" "-*"&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 03:03:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-words-and-digits-from-a-particular-field/m-p/483550#M135378</guid>
      <dc:creator>majek81</dc:creator>
      <dc:date>2020-09-30T03:03:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract words and digits from a particular field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-words-and-digits-from-a-particular-field/m-p/483551#M135379</link>
      <description>&lt;P&gt;Come back and &lt;CODE&gt;UpVote&lt;/CODE&gt; this answer, then post your own answer and click &lt;CODE&gt;Accept&lt;/CODE&gt; on it to close the question.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Nov 2019 22:33:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-words-and-digits-from-a-particular-field/m-p/483551#M135379</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-11-21T22:33:49Z</dc:date>
    </item>
  </channel>
</rss>

