<?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 Correct Syntax for rex for a user in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Correct-Syntax-for-rex-for-a-user/m-p/686112#M234093</link>
    <description>&lt;P&gt;I have a simple search&amp;nbsp;&lt;/P&gt;&lt;P&gt;index=xxxxx "User ID" and I need the correct syntax to get the actual username in the results.&lt;/P&gt;&lt;P&gt;Sample Event&lt;/P&gt;&lt;P&gt;INFO xcvxcvxcvxcvxcvxcvxcvxcvxcvxcvvcx - Logged User ID-XXXXXX&lt;/P&gt;&lt;P&gt;Now I can easy do a count of how many people logged on but need to report on the XXXXXX&lt;/P&gt;&lt;P&gt;I thought about doing&lt;/P&gt;&lt;P&gt;index=xxxxx 'User ID" | rex field=_raw "User\/s\ID\/-\(?&amp;lt;username&amp;gt;\d+)" | stats count by username&lt;/P&gt;&lt;P&gt;The search is returning the results and just a count but I need to see the username in my stats.&lt;/P&gt;&lt;P&gt;I am new to this so please mind the ignorance&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 01 May 2024 18:15:40 GMT</pubDate>
    <dc:creator>LizAndy123</dc:creator>
    <dc:date>2024-05-01T18:15:40Z</dc:date>
    <item>
      <title>Correct Syntax for rex for a user</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Correct-Syntax-for-rex-for-a-user/m-p/686112#M234093</link>
      <description>&lt;P&gt;I have a simple search&amp;nbsp;&lt;/P&gt;&lt;P&gt;index=xxxxx "User ID" and I need the correct syntax to get the actual username in the results.&lt;/P&gt;&lt;P&gt;Sample Event&lt;/P&gt;&lt;P&gt;INFO xcvxcvxcvxcvxcvxcvxcvxcvxcvxcvvcx - Logged User ID-XXXXXX&lt;/P&gt;&lt;P&gt;Now I can easy do a count of how many people logged on but need to report on the XXXXXX&lt;/P&gt;&lt;P&gt;I thought about doing&lt;/P&gt;&lt;P&gt;index=xxxxx 'User ID" | rex field=_raw "User\/s\ID\/-\(?&amp;lt;username&amp;gt;\d+)" | stats count by username&lt;/P&gt;&lt;P&gt;The search is returning the results and just a count but I need to see the username in my stats.&lt;/P&gt;&lt;P&gt;I am new to this so please mind the ignorance&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 01 May 2024 18:15:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Correct-Syntax-for-rex-for-a-user/m-p/686112#M234093</guid>
      <dc:creator>LizAndy123</dc:creator>
      <dc:date>2024-05-01T18:15:40Z</dc:date>
    </item>
    <item>
      <title>Re: Correct Syntax for rex for a user</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Correct-Syntax-for-rex-for-a-user/m-p/686114#M234095</link>
      <description>&lt;P&gt;The regular expression in the &lt;FONT face="courier new,courier"&gt;rex &lt;/FONT&gt;command has some misplaced escape characters that are preventing matches.&amp;nbsp; Try this query&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=xxxxx 'User ID" 
| rex field=_raw "User\sID-(?&amp;lt;username&amp;gt;\w+)" 
| stats count by username&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 01 May 2024 18:30:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Correct-Syntax-for-rex-for-a-user/m-p/686114#M234095</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2024-05-01T18:30:18Z</dc:date>
    </item>
  </channel>
</rss>

