<?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: Can you help me with a regex field extraction? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-with-a-regex-field-extraction/m-p/458034#M129361</link>
    <description>&lt;P&gt;@PanIrosha&lt;BR /&gt;
Have you tried with comparing with raw?&lt;/P&gt;

&lt;P&gt;Can you please try with this?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;**Extraction and Transform:**  event.computer.user=(?&amp;lt;user&amp;gt;[^@]+)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Note: Here I have assumed that _raw is like below.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;event.computer.user=abc@xyz.com
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 01 Nov 2018 12:23:19 GMT</pubDate>
    <dc:creator>kamlesh_vaghela</dc:creator>
    <dc:date>2018-11-01T12:23:19Z</dc:date>
    <item>
      <title>Can you help me with a regex field extraction?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-with-a-regex-field-extraction/m-p/458033#M129360</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;

&lt;P&gt;i have installed and configured "Cisco AMP for Endpoints" in our search head. Currently, it's forwarding all the logs to an index called "Cisco-AMP". I can see all events coming in. There is a field called "event.computer.user" this store email address of the user.  i need to extract just the user name from this field and add it to another field called "User". &lt;/P&gt;

&lt;P&gt;The following Regex does that perfectly when i run it on the search bar.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=amp | rex field=event.computer.user "(?&amp;lt;user&amp;gt;[^@]+)"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;But i need this extraction to work permanently. So i created a field extraction by taking the below steps. Then I restarted Splunk services. But i can't see the new field when i search for the Cisco amp events in the search app.  Am i doing anything wrong here ?&lt;/P&gt;

&lt;P&gt;Settings &amp;gt; Fields &amp;gt; Filed Extraction &amp;gt;&lt;/P&gt;

&lt;P&gt;Destination App: Cisco-AMPEvents&lt;BR /&gt;
Name: User_field_extract&lt;BR /&gt;
Sourcetype: cisco:amp:event&lt;BR /&gt;
Type: inline&lt;BR /&gt;
Extraction and Transform: &lt;CODE&gt;field=event.computer.user "(?&amp;lt;user&amp;gt;[^@]+)"&lt;/CODE&gt;&lt;BR /&gt;
App Permission: Global&lt;/P&gt;

&lt;P&gt;Thank you in advance.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 21:52:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-with-a-regex-field-extraction/m-p/458033#M129360</guid>
      <dc:creator>PanIrosha</dc:creator>
      <dc:date>2020-09-29T21:52:36Z</dc:date>
    </item>
    <item>
      <title>Re: Can you help me with a regex field extraction?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-with-a-regex-field-extraction/m-p/458034#M129361</link>
      <description>&lt;P&gt;@PanIrosha&lt;BR /&gt;
Have you tried with comparing with raw?&lt;/P&gt;

&lt;P&gt;Can you please try with this?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;**Extraction and Transform:**  event.computer.user=(?&amp;lt;user&amp;gt;[^@]+)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Note: Here I have assumed that _raw is like below.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;event.computer.user=abc@xyz.com
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 01 Nov 2018 12:23:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-with-a-regex-field-extraction/m-p/458034#M129361</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2018-11-01T12:23:19Z</dc:date>
    </item>
    <item>
      <title>Re: Can you help me with a regex field extraction?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-with-a-regex-field-extraction/m-p/458035#M129362</link>
      <description>&lt;P&gt;hi @kamlesh_vaghela&lt;/P&gt;

&lt;P&gt;Thank you for the quick response.&lt;/P&gt;

&lt;P&gt;in the raw log has following&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;"user": "firstName.LastName@DomainName.com"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 01 Nov 2018 12:34:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-with-a-regex-field-extraction/m-p/458035#M129362</guid>
      <dc:creator>PanIrosha</dc:creator>
      <dc:date>2018-11-01T12:34:50Z</dc:date>
    </item>
    <item>
      <title>Re: Can you help me with a regex field extraction?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-with-a-regex-field-extraction/m-p/458036#M129363</link>
      <description>&lt;P&gt;Is this a JSON event??&lt;/P&gt;

&lt;P&gt;Can you please share sample events?? Replace the sensitive value with dummy one.&lt;/P&gt;</description>
      <pubDate>Thu, 01 Nov 2018 12:36:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-with-a-regex-field-extraction/m-p/458036#M129363</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2018-11-01T12:36:58Z</dc:date>
    </item>
    <item>
      <title>Re: Can you help me with a regex field extraction?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-with-a-regex-field-extraction/m-p/458037#M129364</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/127939"&gt;@kamlesh_vaghela&lt;/a&gt;&lt;/P&gt;

&lt;P&gt;below is the sample raw event&lt;/P&gt;

&lt;P&gt;{"event": {"event_type": "Threat Detected", "timestamp_nanoseconds": 543000000, "date": "2018-10-29T12:20:53+00:00", "file": {"disposition": "Malicious", "identity": {"md5": "44d88612fea8a8f36de82e1278abb02f", "sha1": "3395856ce81f2b7382dee72602f798b642f14140", "sha256": "275a021bbfb6489e54d471899f7db9d1663fc695ec2fe2a2c4538aabf651fd0f"}, "file_name": "f9ab116c-40f5-40db-a566-4d3d948587c3.tmp", "file_path": "\\?\C:\Users\User.Name\Downloads\f9ab116c-40f5-40db-a566-4d3d948587c3.tmp", "parent": {"disposition": "Clean", "identity": {"md5": "f8ba54ad76c8f8ec9f3d639871b30f27", "sha1": "d42ea42b362442299195a82cfb998f10b11af868", "sha256": "c0edc58682b6fa296a439da2320c8bf74d7bf5f8e83446441048687beb60a472"}, "file_name": "chrome.exe", "process_id": 13132}}, "computer": {"links": {"trajectory": "&lt;A href="https://api.eu.amp.cisco.com" target="_blank"&gt;https://api.eu.amp.cisco.com&lt;/A&gt;", "computer": "&lt;A href="https://api.eu.amp.cisco.com" target="_blank"&gt;https://api.eu.amp.cisco.com&lt;/A&gt;", "group": "&lt;A href="https://api.eu.amp.cisco.com%22" target="_blank"&gt;https://api.eu.amp.cisco.com"&lt;/A&gt;}, "connector_guid": "ec10a6ba-1bf2-42d8-8254-77fbcea54c6a", "active": true, "hostname": "Demo-PC-001", "user": "&lt;A href="mailto:firstName.LastName@Domain.com" target="_blank"&gt;firstName.LastName@Domain.com&lt;/A&gt;", "external_ip": "xxx.xxx.xxx.xxx", "network_addresses": [{"ip": "xxx.xxx.xxx.xxx", "mac": "xx:xx:xx:xx:xx:xx"}, {"ip": "xxx.xxx.xxx.xxx", "mac": "xx:xx:xx:xx:xx:xx"}, {"ip": "xxx.xxx.xxx.xxx", "mac": "xx:xx:xx:xx:xx:xx"}, {"ip": "xxx.xxx.xxx.xxx", "mac": "xx:xx:xx:xx:xx:xx"}]}, "id": 6617752838799884295, "timestamp": 1540815653, "connector_guid": "asas-weuwuey-kjhdfkjaf", "event_type_id": 1090519054, "detection": "Win.Trojan.EICAR-Test-File", "detection_id": "6617752838799884292", "group_guids": ["272362aashasah13276237623jsdhjsdjsh"]}}&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 21:52:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-with-a-regex-field-extraction/m-p/458037#M129364</guid>
      <dc:creator>PanIrosha</dc:creator>
      <dc:date>2020-09-29T21:52:39Z</dc:date>
    </item>
    <item>
      <title>Re: Can you help me with a regex field extraction?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-with-a-regex-field-extraction/m-p/458038#M129365</link>
      <description>&lt;P&gt;hi &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/127939"&gt;@kamlesh_vaghela&lt;/a&gt;&lt;/P&gt;

&lt;P&gt;i think its working now. &lt;/P&gt;

&lt;P&gt;Step 1: i have created a regex based field transform with following settings.&lt;/P&gt;

&lt;P&gt;Name: field_extraction_for_user&lt;BR /&gt;
Type: RegEx Based&lt;BR /&gt;
RegEx:(?[^@]+)&lt;BR /&gt;
App: Cisco_AMP&lt;BR /&gt;
Source Key: event.computer.user&lt;/P&gt;

&lt;P&gt;Step 2: then i have created a field extraction.&lt;/P&gt;

&lt;P&gt;App: Cisco_AMP&lt;BR /&gt;
Name: User_Extraction&lt;BR /&gt;
SourceType: Cisco:AMP&lt;BR /&gt;
Type: Uses transform&lt;BR /&gt;
Extraction/Transform: "name of the field transform above"&lt;/P&gt;

&lt;P&gt;Thank you very much for your help.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 21:52:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-with-a-regex-field-extraction/m-p/458038#M129365</guid>
      <dc:creator>PanIrosha</dc:creator>
      <dc:date>2020-09-29T21:52:42Z</dc:date>
    </item>
    <item>
      <title>Re: Can you help me with a regex field extraction?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-with-a-regex-field-extraction/m-p/458039#M129366</link>
      <description>&lt;P&gt;@PanIrosha&lt;/P&gt;

&lt;P&gt;Glad to help you.  &lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;!!! Happy Splunking !!!&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Nov 2018 13:54:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-you-help-me-with-a-regex-field-extraction/m-p/458039#M129366</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2018-11-01T13:54:41Z</dc:date>
    </item>
  </channel>
</rss>

