<?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 How to extract text from raw data using rex? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-text-from-raw-data-using-rex/m-p/595470#M207241</link>
    <description>&lt;P&gt;I'm new to regex and having trouble extracting some text. My raw data is in the following format:&lt;/P&gt;&lt;PRE&gt;ID=[12839829389-8b7e89opf][2839128391DJ33838PR]&lt;/PRE&gt;&lt;P&gt;I need to extract the text between the first two brackets,12839829389-8b7e89opf, into a new field.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So far what I have does not work:&lt;STRONG&gt; |&lt;/STRONG&gt;&amp;nbsp;&lt;STRONG&gt;rex field=_raw "ID=[(?&amp;lt;id&amp;gt;.*)]"&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;If anyone could help it would be greatly appreciated.&lt;/P&gt;</description>
    <pubDate>Tue, 26 Apr 2022 19:03:13 GMT</pubDate>
    <dc:creator>9jamie</dc:creator>
    <dc:date>2022-04-26T19:03:13Z</dc:date>
    <item>
      <title>How to extract text from raw data using rex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-text-from-raw-data-using-rex/m-p/595470#M207241</link>
      <description>&lt;P&gt;I'm new to regex and having trouble extracting some text. My raw data is in the following format:&lt;/P&gt;&lt;PRE&gt;ID=[12839829389-8b7e89opf][2839128391DJ33838PR]&lt;/PRE&gt;&lt;P&gt;I need to extract the text between the first two brackets,12839829389-8b7e89opf, into a new field.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So far what I have does not work:&lt;STRONG&gt; |&lt;/STRONG&gt;&amp;nbsp;&lt;STRONG&gt;rex field=_raw "ID=[(?&amp;lt;id&amp;gt;.*)]"&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;If anyone could help it would be greatly appreciated.&lt;/P&gt;</description>
      <pubDate>Tue, 26 Apr 2022 19:03:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-text-from-raw-data-using-rex/m-p/595470#M207241</guid>
      <dc:creator>9jamie</dc:creator>
      <dc:date>2022-04-26T19:03:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract text from raw data using rex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-text-from-raw-data-using-rex/m-p/595471#M207242</link>
      <description>&lt;P&gt;Square brackets are special characters in regex so need to be escaped with backslashes&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex field=_raw "ID=\[(?&amp;lt;id&amp;gt;.*)\]"&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 26 Apr 2022 19:09:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-text-from-raw-data-using-rex/m-p/595471#M207242</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-04-26T19:09:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract text from raw data using rex?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-text-from-raw-data-using-rex/m-p/595473#M207243</link>
      <description>&lt;P&gt;this returns everything after ID up until the final closing bracket. so i added the brackets containing the second part of the id as well. final solution:&lt;/P&gt;&lt;PRE&gt;rex field=_raw "ID=\[(?&amp;lt;id&amp;gt;.*\]\[.*\]"&lt;/PRE&gt;&lt;P&gt;thanks for the help&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Apr 2022 19:42:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-text-from-raw-data-using-rex/m-p/595473#M207243</guid>
      <dc:creator>9jamie</dc:creator>
      <dc:date>2022-04-26T19:42:35Z</dc:date>
    </item>
  </channel>
</rss>

