<?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 Extract username with dash (-) Field from event in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Extract-username-with-dash-Field-from-event/m-p/575079#M200387</link>
    <description>&lt;P&gt;Hello Everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to extract usernames from the logs of a proftpd.&lt;/P&gt;&lt;P&gt;An event looks like this:&lt;/P&gt;&lt;P&gt;2021-11-16 16:17:43,866 HOST proftpd[28071] 10.10.10.10 (11.11.11.11[22.22.22.22]): USER ASD-ASDASD: Login successful.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Simple usernames (ASDFG) works fine, also usernames with _ like ASD_ASD. But as soon as the username contains - character, its only extract the first part &lt;STRONG&gt;ASD&lt;/STRONG&gt;-ASDASD&lt;/P&gt;&lt;P&gt;How do I circumvent this? How can I extract strings that contains - ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 16 Nov 2021 15:56:11 GMT</pubDate>
    <dc:creator>miberecz</dc:creator>
    <dc:date>2021-11-16T15:56:11Z</dc:date>
    <item>
      <title>Extract username with dash (-) Field from event</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extract-username-with-dash-Field-from-event/m-p/575079#M200387</link>
      <description>&lt;P&gt;Hello Everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to extract usernames from the logs of a proftpd.&lt;/P&gt;&lt;P&gt;An event looks like this:&lt;/P&gt;&lt;P&gt;2021-11-16 16:17:43,866 HOST proftpd[28071] 10.10.10.10 (11.11.11.11[22.22.22.22]): USER ASD-ASDASD: Login successful.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Simple usernames (ASDFG) works fine, also usernames with _ like ASD_ASD. But as soon as the username contains - character, its only extract the first part &lt;STRONG&gt;ASD&lt;/STRONG&gt;-ASDASD&lt;/P&gt;&lt;P&gt;How do I circumvent this? How can I extract strings that contains - ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Nov 2021 15:56:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extract-username-with-dash-Field-from-event/m-p/575079#M200387</guid>
      <dc:creator>miberecz</dc:creator>
      <dc:date>2021-11-16T15:56:11Z</dc:date>
    </item>
    <item>
      <title>Re: Extract username with dash (-) Field from event</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extract-username-with-dash-Field-from-event/m-p/575082#M200388</link>
      <description>&lt;P&gt;What extraction are you currently using?&lt;/P&gt;</description>
      <pubDate>Tue, 16 Nov 2021 16:01:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extract-username-with-dash-Field-from-event/m-p/575082#M200388</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-11-16T16:01:34Z</dc:date>
    </item>
    <item>
      <title>Re: Extract username with dash (-) Field from event</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extract-username-with-dash-Field-from-event/m-p/575084#M200389</link>
      <description>&lt;P&gt;It was extracted automatically, and so far I trusted it until I realized its not complete. Now I believe I need a regex the gets everything&amp;nbsp; after the string USER and before the :&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Nov 2021 16:11:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extract-username-with-dash-Field-from-event/m-p/575084#M200389</guid>
      <dc:creator>miberecz</dc:creator>
      <dc:date>2021-11-16T16:11:17Z</dc:date>
    </item>
    <item>
      <title>Re: Extract username with dash (-) Field from event</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extract-username-with-dash-Field-from-event/m-p/575089#M200390</link>
      <description>&lt;P&gt;| makeresults&lt;BR /&gt;| eval _raw = "2021-11-16 16:17:43,866 HOST proftpd[28071] 10.10.10.10 (11.11.11.11[22.22.22.22]): USER ASD-ASDASD: Login successful."&lt;BR /&gt;| rex field=_raw ":\sUSER\s(?&amp;lt;user_id&amp;gt;[^:]*)"&lt;BR /&gt;| table user_id&lt;/P&gt;</description>
      <pubDate>Tue, 16 Nov 2021 16:41:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extract-username-with-dash-Field-from-event/m-p/575089#M200390</guid>
      <dc:creator>johnhuang</dc:creator>
      <dc:date>2021-11-16T16:41:54Z</dc:date>
    </item>
    <item>
      <title>Re: Extract username with dash (-) Field from event</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extract-username-with-dash-Field-from-event/m-p/575100#M200395</link>
      <description>&lt;P&gt;Extracting everything between "USER" and a colon (":") is relatively easy:&lt;/P&gt;&lt;PRE&gt;USER\s(?&amp;lt;username&amp;gt;[^:]*):&lt;/PRE&gt;&lt;P&gt;There is one caveat though. If your username contains a colon (":"), it will only capture the username up to (and without) that colon.&lt;/P&gt;&lt;P&gt;BTW, you could try TA for proftpd - &lt;A href="https://github.com/jewnix/TA-proftpd" target="_blank"&gt;https://github.com/jewnix/TA-proftpd&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Nov 2021 17:53:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extract-username-with-dash-Field-from-event/m-p/575100#M200395</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2021-11-16T17:53:10Z</dc:date>
    </item>
  </channel>
</rss>

