<?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 regex information from two lines? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-regex-information-from-two-lines/m-p/330798#M98457</link>
    <description>&lt;P&gt;yes this one gives just the name which is what I need.&lt;BR /&gt;
Strange part is that when I use your regex on the entire _raw event, it does not work.&lt;BR /&gt;
It works in the regex101 editor though...&lt;BR /&gt;
Thanks&lt;/P&gt;</description>
    <pubDate>Thu, 08 Jun 2017 21:29:52 GMT</pubDate>
    <dc:creator>packet_hunter</dc:creator>
    <dc:date>2017-06-08T21:29:52Z</dc:date>
    <item>
      <title>How to regex information from two lines?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-regex-information-from-two-lines/m-p/330794#M98453</link>
      <description>&lt;P&gt;I am trying to create and add a regex stanza to Windows TA to parse out a username.&lt;BR /&gt;
This is for event code 516 from a windows security event log.&lt;BR /&gt;
The Windows TA does not parse out a username quite right.&lt;/P&gt;

&lt;P&gt;The raw event writes the information on two separate lines.&lt;BR /&gt;
...&lt;BR /&gt;
User:&lt;BR /&gt;
&lt;A href="mailto:employeename@company.com"&gt;employeename@company.com&lt;/A&gt;&lt;BR /&gt;
....&lt;/P&gt;

&lt;P&gt;I started my stanza (with the help of regex101.com)   but I am not having success writing a regex that matches [User: ] and then drops to the next line and copies the employee name out of the email address.&lt;/P&gt;

&lt;P&gt;Here is my starting effort...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;# Event Code 516 
[User:_as_user]
SOURCE_KEY = User:
REGEX = ???
FORMAT = ???
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Please advise how it might be written.  Please let me know if you need more information.&lt;/P&gt;

&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jun 2017 20:57:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-regex-information-from-two-lines/m-p/330794#M98453</guid>
      <dc:creator>packet_hunter</dc:creator>
      <dc:date>2017-06-08T20:57:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to regex information from two lines?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-regex-information-from-two-lines/m-p/330795#M98454</link>
      <description>&lt;P&gt;See if this works for you&lt;/P&gt;

&lt;P&gt;props.conf on your search head&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[YourSourceTypeName]
EXTRACT-username = User\:([\r\n]*)(?&amp;lt;UserName&amp;gt;\S+)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Regex101 link&lt;BR /&gt;
&lt;A href="https://regex101.com/r/9THuiH/1"&gt;https://regex101.com/r/9THuiH/1&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jun 2017 21:12:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-regex-information-from-two-lines/m-p/330795#M98454</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-06-08T21:12:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to regex information from two lines?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-regex-information-from-two-lines/m-p/330796#M98455</link>
      <description>&lt;P&gt;Hello packet_hunter&lt;/P&gt;

&lt;P&gt;On regex101 this one works fine for me:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;User:\n(?&amp;lt;User&amp;gt;.+)@
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I just used your example&lt;/P&gt;

&lt;P&gt;...&lt;BR /&gt;
User:&lt;BR /&gt;
&lt;A href="mailto:employeename@company.com"&gt;employeename@company.com&lt;/A&gt;&lt;BR /&gt;
....&lt;/P&gt;

&lt;P&gt;and i get "employeename" as result. Have you tried this one?&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jun 2017 21:18:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-regex-information-from-two-lines/m-p/330796#M98455</guid>
      <dc:creator>lukas_loder</dc:creator>
      <dc:date>2017-06-08T21:18:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to regex information from two lines?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-regex-information-from-two-lines/m-p/330797#M98456</link>
      <description>&lt;P&gt;Thank you, I will give it a try.&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jun 2017 21:24:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-regex-information-from-two-lines/m-p/330797#M98456</guid>
      <dc:creator>packet_hunter</dc:creator>
      <dc:date>2017-06-08T21:24:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to regex information from two lines?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-regex-information-from-two-lines/m-p/330798#M98457</link>
      <description>&lt;P&gt;yes this one gives just the name which is what I need.&lt;BR /&gt;
Strange part is that when I use your regex on the entire _raw event, it does not work.&lt;BR /&gt;
It works in the regex101 editor though...&lt;BR /&gt;
Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jun 2017 21:29:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-regex-information-from-two-lines/m-p/330798#M98457</guid>
      <dc:creator>packet_hunter</dc:creator>
      <dc:date>2017-06-08T21:29:52Z</dc:date>
    </item>
  </channel>
</rss>

