<?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: Extract data from one field ot another using Regex in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Extract-data-from-one-field-ot-another-using-Regex/m-p/632985#M219886</link>
    <description>&lt;LI-CODE lang="markup"&gt;| rex field=DATA_FIELD "name=(?&amp;lt;HOSTNAME_FIELD&amp;gt;\S*?)\s"&lt;/LI-CODE&gt;</description>
    <pubDate>Thu, 02 Mar 2023 12:14:31 GMT</pubDate>
    <dc:creator>ITWhisperer</dc:creator>
    <dc:date>2023-03-02T12:14:31Z</dc:date>
    <item>
      <title>Extract data from one field ot another using Regex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extract-data-from-one-field-ot-another-using-Regex/m-p/632984#M219885</link>
      <description>&lt;P&gt;Hello,&lt;BR /&gt;(I will use fictional data to give examples)&lt;/P&gt;&lt;P&gt;I'm trying to use regex to extract data from one field to another, but Splunk doesn't find the data I want in this specific field.&lt;/P&gt;&lt;P&gt;The field I want to extract data (let's call it &lt;STRONG&gt;DATA_FIELD&lt;/STRONG&gt;) looks something like:&lt;BR /&gt;SMBv2 guid=111111-b111-1111-1111-11111aaaa11 time=2023-02-27 15:17:35 domain=DOMAINNAME version=12.1.11111 ntlm-ver=15 domain=DOMAINNAME name=HOSTNAME domain-dns=DOMAINDNS name-dns=NAMEDNS&lt;/P&gt;&lt;P&gt;I want to extract &lt;STRONG&gt;"name=HOSTNAME"&lt;/STRONG&gt; from this field to another one (&lt;STRONG&gt;HOSTNAME_FIELD&lt;/STRONG&gt;)&lt;BR /&gt;I suspect my Regex parameters are not working with Splunk, even though I tested them all in &lt;A href="http://regex101.com" target="_self"&gt;regex101&lt;/A&gt;&amp;nbsp;.&lt;BR /&gt;Example:&lt;BR /&gt;&lt;STRONG&gt;| rex field=DATA_FIELD "HOSTNAME_FIELD: name=(?&amp;lt;name&amp;gt;\S*(?))\s"&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I tried many forms of regex, such as:&lt;BR /&gt;&lt;STRONG&gt;name.(?&amp;lt;=[=])\S*(?:\s)?&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;.name=(?&amp;lt;=[=])\S*(?)&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;name=(?&amp;lt;name&amp;gt;\S*(?))\s&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;None of them worked in Splunk but they work in&amp;nbsp;&lt;A href="http://regex101.com" target="_self"&gt;regex101&lt;/A&gt;.&lt;BR /&gt;&lt;BR /&gt;Is this problem on the regex formula itself on Splunk? Or is it problem with the sintax?&lt;BR /&gt;What's the best way to extract this data?&lt;/P&gt;</description>
      <pubDate>Thu, 02 Mar 2023 12:09:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extract-data-from-one-field-ot-another-using-Regex/m-p/632984#M219885</guid>
      <dc:creator>PTC_</dc:creator>
      <dc:date>2023-03-02T12:09:44Z</dc:date>
    </item>
    <item>
      <title>Re: Extract data from one field ot another using Regex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extract-data-from-one-field-ot-another-using-Regex/m-p/632985#M219886</link>
      <description>&lt;LI-CODE lang="markup"&gt;| rex field=DATA_FIELD "name=(?&amp;lt;HOSTNAME_FIELD&amp;gt;\S*?)\s"&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 02 Mar 2023 12:14:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extract-data-from-one-field-ot-another-using-Regex/m-p/632985#M219886</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2023-03-02T12:14:31Z</dc:date>
    </item>
  </channel>
</rss>

