<?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 Working with eventtypes in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Working-with-eventtypes/m-p/22976#M4027</link>
    <description>&lt;P&gt;I'm wondering if someone can provide me with a suggestion on how to handle this (probably straight-forward) scenario.&lt;/P&gt;

&lt;P&gt;So here's an event:&lt;/P&gt;

&lt;P&gt;PSAPPSRV.14586 (13) &lt;A href="https://community.splunk.com/3" target="_blank"&gt;07/12/12 09:17:46 GetCertificate&lt;/A&gt; Sign on PeopleCode authentication succeeded for user &lt;A href="mailto:ABCUSER123@foo.xyz.com" target="_blank"&gt;ABCUSER123@foo.xyz.com&lt;/A&gt;.&lt;/P&gt;

&lt;P&gt;Here's a similar event:&lt;/P&gt;

&lt;P&gt;PSAPPSRV.29564 (7) &lt;A href="https://community.splunk.com/3" target="_blank"&gt;07/22/12 02:37:15 GetCertificate&lt;/A&gt; Sign on PeopleCode authentication succeeded for user &lt;A href="mailto:ABCUSER123@987.123.456.33" target="_blank"&gt;ABCUSER123@987.123.456.33&lt;/A&gt;.    &lt;/P&gt;

&lt;P&gt;They're similar except that one event has a user/hostname, the other has a user/IP address.&lt;BR /&gt;
(The hostnames/IP addresses have been modified for anonymity.)&lt;/P&gt;

&lt;P&gt;What I want to do is have a single event type called "ps_login_success" that will include events from any user from any host or IP.&lt;/P&gt;

&lt;P&gt;I also want to extract two fields from these events: the "ps_user" (ABCUSER123) and, depending on context, either the remote hostname or the remote IP. &lt;/P&gt;

&lt;P&gt;So my questions:&lt;/P&gt;

&lt;OL&gt;
&lt;LI&gt;&lt;P&gt;The eventtype wizard can't quite do what I need it to do. What does this eventtype definition look like if I need to do it manually?&lt;/P&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;P&gt;Similar question regarding the field extractions.. I can't get the field extractor to do what I need it to do either. Am I creating two regex's, one for each scenario? Or is there a way to do it with one?&lt;/P&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;P&gt;Should I extract the fields within the context of the eventtype? Or should the field extraction be separate from the eventtype?&lt;/P&gt;&lt;/LI&gt;
&lt;/OL&gt;

&lt;P&gt;Thank you in advance for your assistance!&lt;/P&gt;</description>
    <pubDate>Mon, 28 Sep 2020 12:10:56 GMT</pubDate>
    <dc:creator>Branden</dc:creator>
    <dc:date>2020-09-28T12:10:56Z</dc:date>
    <item>
      <title>Working with eventtypes</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Working-with-eventtypes/m-p/22976#M4027</link>
      <description>&lt;P&gt;I'm wondering if someone can provide me with a suggestion on how to handle this (probably straight-forward) scenario.&lt;/P&gt;

&lt;P&gt;So here's an event:&lt;/P&gt;

&lt;P&gt;PSAPPSRV.14586 (13) &lt;A href="https://community.splunk.com/3" target="_blank"&gt;07/12/12 09:17:46 GetCertificate&lt;/A&gt; Sign on PeopleCode authentication succeeded for user &lt;A href="mailto:ABCUSER123@foo.xyz.com" target="_blank"&gt;ABCUSER123@foo.xyz.com&lt;/A&gt;.&lt;/P&gt;

&lt;P&gt;Here's a similar event:&lt;/P&gt;

&lt;P&gt;PSAPPSRV.29564 (7) &lt;A href="https://community.splunk.com/3" target="_blank"&gt;07/22/12 02:37:15 GetCertificate&lt;/A&gt; Sign on PeopleCode authentication succeeded for user &lt;A href="mailto:ABCUSER123@987.123.456.33" target="_blank"&gt;ABCUSER123@987.123.456.33&lt;/A&gt;.    &lt;/P&gt;

&lt;P&gt;They're similar except that one event has a user/hostname, the other has a user/IP address.&lt;BR /&gt;
(The hostnames/IP addresses have been modified for anonymity.)&lt;/P&gt;

&lt;P&gt;What I want to do is have a single event type called "ps_login_success" that will include events from any user from any host or IP.&lt;/P&gt;

&lt;P&gt;I also want to extract two fields from these events: the "ps_user" (ABCUSER123) and, depending on context, either the remote hostname or the remote IP. &lt;/P&gt;

&lt;P&gt;So my questions:&lt;/P&gt;

&lt;OL&gt;
&lt;LI&gt;&lt;P&gt;The eventtype wizard can't quite do what I need it to do. What does this eventtype definition look like if I need to do it manually?&lt;/P&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;P&gt;Similar question regarding the field extractions.. I can't get the field extractor to do what I need it to do either. Am I creating two regex's, one for each scenario? Or is there a way to do it with one?&lt;/P&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;P&gt;Should I extract the fields within the context of the eventtype? Or should the field extraction be separate from the eventtype?&lt;/P&gt;&lt;/LI&gt;
&lt;/OL&gt;

&lt;P&gt;Thank you in advance for your assistance!&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 12:10:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Working-with-eventtypes/m-p/22976#M4027</guid>
      <dc:creator>Branden</dc:creator>
      <dc:date>2020-09-28T12:10:56Z</dc:date>
    </item>
    <item>
      <title>Re: Working with eventtypes</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Working-with-eventtypes/m-p/22977#M4028</link>
      <description>&lt;P&gt;First, if you run this search, does it only retrieve events that should belong to the eventtype?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;"Sign on" "authentication succeeded for user"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If yes, then click "Create -&amp;gt; Eventtype" in 4.3. In earlier versions,  choose "Save as event type..." from the Actions menu.&lt;BR /&gt;
Give the eventtype the name "ps_login_success" and save it.&lt;/P&gt;

&lt;P&gt;Second, regarding field extractions. You can do this with one regular expression, like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;"authentication succeeded for user (?P&amp;lt;userName&amp;gt;.*?)@(?P&amp;lt;userDomain&amp;gt;\.*?)\.\s"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You could put this in props.conf, or use it in a rex command:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;yoursearchhere 
| rex "authentication succeeded for user (?P&amp;lt;userName&amp;gt;.*?)@(?P&amp;lt;userDomain&amp;gt;\.*?)\.\s" 
| stats count by userDomain userName
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;In props.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[sourcetypenamehere]
EXTRACT-e1= "authentication succeeded for user (?P&amp;lt;userName&amp;gt;.*?)@(?P&amp;lt;userDomain&amp;gt;\.*?)\.\s"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The field extraction is separate from the eventtype.&lt;/P&gt;</description>
      <pubDate>Thu, 02 Aug 2012 02:49:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Working-with-eventtypes/m-p/22977#M4028</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2012-08-02T02:49:09Z</dc:date>
    </item>
    <item>
      <title>Re: Working with eventtypes</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Working-with-eventtypes/m-p/22978#M4029</link>
      <description>&lt;P&gt;Thank you for your response. The trouble I ran into was figuring out how to distinguish one eventtype "format" from the other (i.e. one with a hostname from one with an IP). Then it turns out there was a third format. Ugh! &lt;/P&gt;

&lt;P&gt;I got around this using the "punct" feature. However, I think your suggestion is simpler. I will give it a try, thanks!&lt;/P&gt;</description>
      <pubDate>Mon, 06 Aug 2012 13:45:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Working-with-eventtypes/m-p/22978#M4029</guid>
      <dc:creator>Branden</dc:creator>
      <dc:date>2012-08-06T13:45:47Z</dc:date>
    </item>
  </channel>
</rss>

