<?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 field from the text in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-a-field-from-the-text/m-p/670530#M229852</link>
    <description>&lt;P&gt;This string appears twice, which one do you want to extract - in order for rex to find the right string, you need to define the pattern of characters around (either before, after or both) - unless you always want&lt;SPAN&gt;&amp;nbsp;ib12345, in which case, this should work&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex "(?&amp;lt;field&amp;gt;ib12345)"&lt;/LI-CODE&gt;</description>
    <pubDate>Sat, 02 Dec 2023 15:24:34 GMT</pubDate>
    <dc:creator>ITWhisperer</dc:creator>
    <dc:date>2023-12-02T15:24:34Z</dc:date>
    <item>
      <title>How to extract a field from the text</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-a-field-from-the-text/m-p/670528#M229851</link>
      <description>&lt;P&gt;&lt;SPAN class=""&gt;Dec&lt;/SPAN&gt; &lt;SPAN class=""&gt;2&lt;/SPAN&gt; &lt;SPAN class=""&gt;09:02:17&lt;/SPAN&gt;&amp;nbsp;server1&amp;nbsp;&lt;SPAN class=""&gt;sudo:&lt;/SPAN&gt;&amp;nbsp;ib12345&amp;nbsp;&lt;SPAN class=""&gt;:&lt;/SPAN&gt; &lt;SPAN class=""&gt;TTY=pts/0&lt;/SPAN&gt;&lt;SPAN&gt; ; &lt;/SPAN&gt;&lt;SPAN class=""&gt;PWD=/home/ib12345&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;; &lt;/SPAN&gt;&lt;SPAN class=""&gt;USER=root&lt;/SPAN&gt;&lt;SPAN&gt; ; &lt;/SPAN&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;COMMAND=/bin/su&lt;/SPAN&gt; -&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;I need to extract ib12345 from the above data . &lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 02 Dec 2023 14:42:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-a-field-from-the-text/m-p/670528#M229851</guid>
      <dc:creator>Hema_Nithya</dc:creator>
      <dc:date>2023-12-02T14:42:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract a field from the text</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-a-field-from-the-text/m-p/670530#M229852</link>
      <description>&lt;P&gt;This string appears twice, which one do you want to extract - in order for rex to find the right string, you need to define the pattern of characters around (either before, after or both) - unless you always want&lt;SPAN&gt;&amp;nbsp;ib12345, in which case, this should work&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex "(?&amp;lt;field&amp;gt;ib12345)"&lt;/LI-CODE&gt;</description>
      <pubDate>Sat, 02 Dec 2023 15:24:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-a-field-from-the-text/m-p/670530#M229852</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2023-12-02T15:24:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract a field from the text</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-a-field-from-the-text/m-p/670532#M229854</link>
      <description>&lt;P&gt;&lt;SPAN class=""&gt;sudo:&lt;/SPAN&gt;&amp;nbsp;ib12345&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Value ib12345 will change not constant . It is upi .&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 02 Dec 2023 15:28:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-a-field-from-the-text/m-p/670532#M229854</guid>
      <dc:creator>Hema_Nithya</dc:creator>
      <dc:date>2023-12-02T15:28:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract a field from the text</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-a-field-from-the-text/m-p/670533#M229855</link>
      <description>&lt;P&gt;Assuming your spacing in your example is consistent with your events, then this should work&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex "sudo:\s(?&amp;lt;field&amp;gt;\S+)\s"&lt;/LI-CODE&gt;</description>
      <pubDate>Sat, 02 Dec 2023 15:31:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-a-field-from-the-text/m-p/670533#M229855</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2023-12-02T15:31:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract a field from the text</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-a-field-from-the-text/m-p/670534#M229856</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/92012"&gt;@Hema_Nithya&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;please try this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;! rex "sudo:\s+(?&amp;lt;field&amp;gt;[^ ]+)"&lt;/LI-CODE&gt;&lt;P&gt;that you can test at&amp;nbsp;&lt;A href="https://regex101.com/r/uBkpRh/1" target="_blank"&gt;https://regex101.com/r/uBkpRh/1&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Sat, 02 Dec 2023 15:34:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-a-field-from-the-text/m-p/670534#M229856</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2023-12-02T15:34:29Z</dc:date>
    </item>
  </channel>
</rss>

