<?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 a string from a field that contains letters, numbers and characters? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-a-string-from-a-field-that-contains-letters/m-p/474275#M133407</link>
    <description>&lt;PRE&gt;&lt;CODE&gt;| makeresults |eval x="Ex: policyName = Unrestricted Inbound Access on network security groups instanceId = 5313
policyName = Unrestricted MongoDB Access in network security groups instanceId = 5313
policyName = [Exchange] - CPF totalMatchCount = 12 instanceId = 5319
policyName = Unencrypted OS disks instanceId = 5313
policyName = Check Disable Telnet (port 23) access on Network Security Groups from Internet instanceId = 5313" | rex field=x "policyName+\s+\=(?&amp;lt;pname&amp;gt;.*?)instanceId" max_match=0
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 09 Sep 2019 18:09:04 GMT</pubDate>
    <dc:creator>Sukisen1981</dc:creator>
    <dc:date>2019-09-09T18:09:04Z</dc:date>
    <item>
      <title>How to extract a string from a field that contains letters, numbers and characters?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-a-string-from-a-field-that-contains-letters/m-p/474274#M133406</link>
      <description>&lt;P&gt;731/5000&lt;BR /&gt;
How to extract a field that can contain letters, numbers and characters, as in the example below? &lt;BR /&gt;
The field to extract is the policyName that always comes preceded by the instanceId field.&lt;/P&gt;

&lt;P&gt;Ex: &lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;policyName = Unrestricted Inbound Access on network security groups instanceId = 5313&lt;BR /&gt;
policyName = Unrestricted MongoDB Access in network security groups instanceId = 5313&lt;BR /&gt;
policyName = [Exchange] - CPF totalMatchCount = 12 instanceId = 5319&lt;BR /&gt;
policyName = Unencrypted OS disks instanceId = 5313&lt;BR /&gt;
policyName = Check Disable Telnet (port 23) access on Network Security Groups from Internet instanceId = 5313&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;I have tried several ways, but it is only extracting the first word after the "=" sign, eg. "[Exchange]", "Unrestricted", etc ...&lt;/P&gt;

&lt;P&gt;Can anyone help?&lt;/P&gt;

&lt;P&gt;Thank you very much in advance.&lt;/P&gt;</description>
      <pubDate>Mon, 09 Sep 2019 17:48:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-a-string-from-a-field-that-contains-letters/m-p/474274#M133406</guid>
      <dc:creator>jfeitosa_real</dc:creator>
      <dc:date>2019-09-09T17:48:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract a string from a field that contains letters, numbers and characters?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-a-string-from-a-field-that-contains-letters/m-p/474275#M133407</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;| makeresults |eval x="Ex: policyName = Unrestricted Inbound Access on network security groups instanceId = 5313
policyName = Unrestricted MongoDB Access in network security groups instanceId = 5313
policyName = [Exchange] - CPF totalMatchCount = 12 instanceId = 5319
policyName = Unencrypted OS disks instanceId = 5313
policyName = Check Disable Telnet (port 23) access on Network Security Groups from Internet instanceId = 5313" | rex field=x "policyName+\s+\=(?&amp;lt;pname&amp;gt;.*?)instanceId" max_match=0
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 09 Sep 2019 18:09:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-a-string-from-a-field-that-contains-letters/m-p/474275#M133407</guid>
      <dc:creator>Sukisen1981</dc:creator>
      <dc:date>2019-09-09T18:09:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract a string from a field that contains letters, numbers and characters?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-a-string-from-a-field-that-contains-letters/m-p/474276#M133408</link>
      <description>&lt;P&gt;Hi Sukisen!&lt;/P&gt;

&lt;P&gt;It worked in search time. But inline extract does not. What would it look like for extract inline? &lt;/P&gt;

&lt;P&gt;Thank you.&lt;/P&gt;

&lt;P&gt;James&lt;/P&gt;</description>
      <pubDate>Mon, 09 Sep 2019 19:22:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-a-string-from-a-field-that-contains-letters/m-p/474276#M133408</guid>
      <dc:creator>jfeitosa_real</dc:creator>
      <dc:date>2019-09-09T19:22:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract a string from a field that contains letters, numbers and characters?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-a-string-from-a-field-that-contains-letters/m-p/474277#M133409</link>
      <description>&lt;P&gt;hi &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/106855"&gt;@jfeitosa_real&lt;/a&gt; &lt;BR /&gt;
It should work in inline search as well.&lt;BR /&gt;
Is the inline search a table in a dashboard?  If yes, check the time range of the search&lt;BR /&gt;
it could be that your logs are multispaced in that case use this regex - &lt;CODE&gt;rex field=x "(?ms)policyName+\s+\=(?&amp;lt;pname&amp;gt;.*?)instanceId" max_match=0&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 02:09:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-a-string-from-a-field-that-contains-letters/m-p/474277#M133409</guid>
      <dc:creator>Sukisen1981</dc:creator>
      <dc:date>2020-09-30T02:09:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract a string from a field that contains letters, numbers and characters?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-a-string-from-a-field-that-contains-letters/m-p/474278#M133410</link>
      <description>&lt;P&gt;Hi @Sukisen1981 .&lt;/P&gt;

&lt;P&gt;In fact it is to extract the field without research.&lt;/P&gt;

&lt;P&gt;I got it this way: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(?:policyName=(?P&amp;lt;policy&amp;gt;.*)instanceId)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Thanks for your attention, your example helped me find this result.&lt;/P&gt;

&lt;P&gt;Thank you very much.&lt;/P&gt;

&lt;P&gt;James []s&lt;/P&gt;</description>
      <pubDate>Tue, 10 Sep 2019 12:03:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-a-string-from-a-field-that-contains-letters/m-p/474278#M133410</guid>
      <dc:creator>jfeitosa_real</dc:creator>
      <dc:date>2019-09-10T12:03:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract a string from a field that contains letters, numbers and characters?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-a-string-from-a-field-that-contains-letters/m-p/474279#M133411</link>
      <description>&lt;P&gt;To extract the field in inline mode.&lt;/P&gt;

&lt;P&gt;I used this REGEX:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(?:policyName = (?P&amp;lt;policy&amp;gt;.*)instanceId)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Thank you very much.&lt;/P&gt;</description>
      <pubDate>Tue, 10 Sep 2019 12:15:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-a-string-from-a-field-that-contains-letters/m-p/474279#M133411</guid>
      <dc:creator>jfeitosa_real</dc:creator>
      <dc:date>2019-09-10T12:15:37Z</dc:date>
    </item>
  </channel>
</rss>

