<?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 filter the logs when a username field ends with &amp;quot;-TEST&amp;quot; in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/how-to-filter-the-logs-when-a-username-field-ends-with-quot-TEST/m-p/471635#M132691</link>
    <description>&lt;P&gt;try this ? &lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;(logtype::SAT.*id::(ABC-1|ABC-2).*username::[^\-]+\-TEST)&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;OR&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;logtype::SAT.*id::(ABC-1|ABC-2).*username::.*-TEST&lt;/CODE&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 04 Sep 2019 19:05:48 GMT</pubDate>
    <dc:creator>mayurr98</dc:creator>
    <dc:date>2019-09-04T19:05:48Z</dc:date>
    <item>
      <title>how to filter the logs when a username field ends with "-TEST"</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-filter-the-logs-when-a-username-field-ends-with-quot-TEST/m-p/471634#M132690</link>
      <description>&lt;P&gt;The following are my transforms.conf and props.conf in my cluster master which are sending all the logs for the below search &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;logtype=SAT (id="ABC-1" OR id="ABC-2")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;transforms.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;  [send_to_heavyforwarder]
      SOURCE_KEY = _meta
     REGEX = (logtype::SAT.*id::(ABC-1|ABC-2)) 
     DEST_KEY = _TCP_ROUTING
     FORMAT = heavyforwarder_output
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;props.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; [default]
 TRANSFORMS-heavyforwarder= send_to_heavyforwarder
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Now, I want to filter the events when the below search condition met&lt;/P&gt;

&lt;P&gt;logtype=SAT id="ABC-2" username="anything that ends with &lt;STRONG&gt;-TEST&lt;/STRONG&gt;"&lt;/P&gt;

&lt;P&gt;In order to filter the events that match the above condition how to modify my REGEX in transforms.conf. I think I need to use to something like negative look-back but not sure what could be my new syntax that filters the events when username ends with "-TEST"&lt;/P&gt;

&lt;P&gt;Any help would be great. &lt;/P&gt;</description>
      <pubDate>Wed, 04 Sep 2019 18:49:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-filter-the-logs-when-a-username-field-ends-with-quot-TEST/m-p/471634#M132690</guid>
      <dc:creator>pavanae</dc:creator>
      <dc:date>2019-09-04T18:49:21Z</dc:date>
    </item>
    <item>
      <title>Re: how to filter the logs when a username field ends with "-TEST"</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-filter-the-logs-when-a-username-field-ends-with-quot-TEST/m-p/471635#M132691</link>
      <description>&lt;P&gt;try this ? &lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;(logtype::SAT.*id::(ABC-1|ABC-2).*username::[^\-]+\-TEST)&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;OR&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;logtype::SAT.*id::(ABC-1|ABC-2).*username::.*-TEST&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Sep 2019 19:05:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-filter-the-logs-when-a-username-field-ends-with-quot-TEST/m-p/471635#M132691</guid>
      <dc:creator>mayurr98</dc:creator>
      <dc:date>2019-09-04T19:05:48Z</dc:date>
    </item>
    <item>
      <title>Re: how to filter the logs when a username field ends with "-TEST"</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-filter-the-logs-when-a-username-field-ends-with-quot-TEST/m-p/471636#M132692</link>
      <description>&lt;P&gt;Hi @mayurr98 I actually want to exclude any logs which contain "-TEST" at the end of username. The above answer will work if I wanted to include those logs. &lt;/P&gt;

&lt;P&gt;I am trying to find the right syntax for excluding those something like nagative look-back's. &lt;/P&gt;</description>
      <pubDate>Wed, 04 Sep 2019 19:12:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-filter-the-logs-when-a-username-field-ends-with-quot-TEST/m-p/471636#M132692</guid>
      <dc:creator>pavanae</dc:creator>
      <dc:date>2019-09-04T19:12:51Z</dc:date>
    </item>
    <item>
      <title>Re: how to filter the logs when a username field ends with "-TEST"</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-filter-the-logs-when-a-username-field-ends-with-quot-TEST/m-p/471637#M132693</link>
      <description>&lt;P&gt;try this:&lt;/P&gt;

&lt;P&gt;&lt;A href="https://regex101.com/r/QhCN5V/1"&gt;https://regex101.com/r/QhCN5V/1&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;logtype::SAT.*id::(ABC-1|ABC-2).*username::[^\-]+\-(?!TEST)&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;OR &lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;logtype::SAT.*id::(ABC-1|ABC-2).*username::.*-(?!TEST)&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Sep 2019 19:17:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-filter-the-logs-when-a-username-field-ends-with-quot-TEST/m-p/471637#M132693</guid>
      <dc:creator>mayurr98</dc:creator>
      <dc:date>2019-09-04T19:17:24Z</dc:date>
    </item>
    <item>
      <title>Re: how to filter the logs when a username field ends with "-TEST"</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-filter-the-logs-when-a-username-field-ends-with-quot-TEST/m-p/471638#M132694</link>
      <description>&lt;P&gt;Thanks @mayurr98 . It almost worked great but what could be the regex if my username values are as follows&lt;/P&gt;

&lt;P&gt;abc-def-ghi&lt;BR /&gt;
jkl-mno-TEST&lt;BR /&gt;
agh_123&lt;BR /&gt;
ghk-TEST&lt;/P&gt;

&lt;P&gt;Among the above 4 examples. Now, I just want to filter the username value's that ends with -TEST &lt;/P&gt;</description>
      <pubDate>Wed, 04 Sep 2019 20:55:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-filter-the-logs-when-a-username-field-ends-with-quot-TEST/m-p/471638#M132694</guid>
      <dc:creator>pavanae</dc:creator>
      <dc:date>2019-09-04T20:55:19Z</dc:date>
    </item>
  </channel>
</rss>

