<?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: nullQueue : log discard not working in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Why-is-nullQueue-log-discard-not-working/m-p/330356#M61249</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;try using setnull in props.conf :&lt;BR /&gt;
    TRANSFORMS-null = setnull&lt;/P&gt;

&lt;P&gt;And in transforms.conf:&lt;BR /&gt;
    [setnull]&lt;BR /&gt;
     REGEX = .&lt;BR /&gt;
     DEST_KEY = queue&lt;BR /&gt;
     FORMAT = nullQueue&lt;/P&gt;</description>
    <pubDate>Tue, 06 Mar 2018 08:55:43 GMT</pubDate>
    <dc:creator>p_gurav</dc:creator>
    <dc:date>2018-03-06T08:55:43Z</dc:date>
    <item>
      <title>Why is nullQueue : log discard not working?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-is-nullQueue-log-discard-not-working/m-p/330354#M61247</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I recently experimented with Splunk transformations in order to &lt;STRONG&gt;discard some log entries&lt;/STRONG&gt; ( and that worked well on my lab setup )&lt;/P&gt;
&lt;P&gt;I am now trying to implement such solution on our main &lt;STRONG&gt;Splunk Enterprise&lt;/STRONG&gt; server in pre-preproduction ( UAT ), but, for some reason, Splunk seems to ignore completly the transformation statements&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;NB&lt;/STRONG&gt; : in order to troubleshoot this behaviour, I already tried lots of things, including, among other things&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;running splunkd in &lt;STRONG&gt;debug&lt;/STRONG&gt; mode&lt;/LI&gt;
&lt;LI&gt;setting &lt;STRONG&gt;global regex(es)&lt;/STRONG&gt; which would include everything&lt;/LI&gt;
&lt;LI&gt;checking the configurations using &lt;STRONG&gt;btool&lt;/STRONG&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;STRONG&gt;restarting&lt;/STRONG&gt; the splunk service ( on the indexer ), countless times&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;... sadly, without any results so far &lt;span class="lia-unicode-emoji" title=":neutral_face:"&gt;😐&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Setup : summary&lt;/STRONG&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;1 x main server / indexer ( Splunk Enterprise 6.4.1 w/ licence )&lt;/LI&gt;
&lt;LI&gt;117 x universal forwarders ( same version as the indexer )&lt;/LI&gt;
&lt;LI&gt;logs which are sent to the indexer : &lt;STRONG&gt;JSON&lt;/STRONG&gt; applicative logs&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;*&lt;EM&gt;Setup : forwarder(s) *&lt;/EM&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;/opt/splunkforwarder/etc/system/local/inputs.conf 

[...]
[monitor:///var/log/vplatform/latest/app.log.json]
index = vplatform_uat_logs
crcSalt = &amp;lt;SOURCE&amp;gt;
sourcetype = VPLATFORM_JSON
[...]
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;*&lt;EM&gt;Setup : indexer *&lt;/EM&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;/opt/splunkforwarder/etc/system/local/indexes.conf

[vplatform_uat_logs]

homePath   = $SPLUNK_DB/vplatform_UAT_logs/db
coldPath   = $SPLUNK_DB/vplatform_UAT_logs/colddb
thawedPath = $SPLUNK_DB/vplatform_UAT_logs/thaweddb
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;/opt/splunk/etc/apps/vplatform_UAT/local/props.conf

[VPLATFORM_JSON]
KV_MODE = none
INDEXED_EXTRACTIONS = JSON
TRUNCATE = 0
TRANSFORMS-null = drop_info_jsons
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;/opt/splunk/etc/apps/vplatform_UAT/local/transforms.conf

[drop_info_jsons]
REGEX = .*
DEST_KEY = queue
FORMAT = nullQueue
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Behaviour&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;According to the setup above, all JSON logs sent from the forwarders, with the sourcetype &lt;STRONG&gt;VPLATFORM_JSON&lt;/STRONG&gt;, should be discarded&lt;/P&gt;
&lt;P&gt;But unfortunately, this isn't the case.&lt;/P&gt;
&lt;P&gt;If I issue the a query in the &lt;STRONG&gt;Splunk search app&lt;/STRONG&gt;, it still gives results&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Query&lt;/STRONG&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;index="vplatform_uat_logs" sourcetype="VPLATFORM_JSON"
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;STRONG&gt;Result sample&lt;/STRONG&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt; { [-]
   @level: INFO
   @level_value: 20000
   @service_name: vplatform-datamanager
   hostname: t1vbbservice.*****
   processId: 25568
   version: 2.5.0-9243
} 

host = t1vbbservice.******
source = /var/log/vplatform/latest/app.log.json
sourcetype = VPLATFORM_JSON
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;STRONG&gt;Solution ?&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;If someone could try to give me a clue about the reason Splunk is apparently not taking the transformation statements present in &lt;STRONG&gt;props&lt;/STRONG&gt; &amp;amp; &lt;STRONG&gt;transforms&lt;/STRONG&gt;, I would really appreciate it ( I have already spent two days on this issue and still don't understand why it is behaving like this )&lt;/P&gt;
&lt;P&gt;Thanks beforehand&lt;/P&gt;</description>
      <pubDate>Thu, 15 Sep 2022 14:43:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-is-nullQueue-log-discard-not-working/m-p/330354#M61247</guid>
      <dc:creator>craymore</dc:creator>
      <dc:date>2022-09-15T14:43:42Z</dc:date>
    </item>
    <item>
      <title>Re: nullQueue : log discard not working</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-is-nullQueue-log-discard-not-working/m-p/330355#M61248</link>
      <description>&lt;P&gt;Hi craymore,&lt;BR /&gt;
at first two quick suggestions:&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;indexed extractions are the only situation where you need to deploy props.conf and transforms.conf also in Universal Forwarder, and not only on Indexers;&lt;/LI&gt;
&lt;LI&gt;&lt;P&gt;regex in transforms.conf doesn't need asterisk&lt;/P&gt;

&lt;P&gt;[drop_info_jsons]&lt;BR /&gt;
REGEX = .&lt;BR /&gt;
DEST_KEY = queue&lt;BR /&gt;
FORMAT = nullQueue&lt;/P&gt;&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;There's a thing that I don't understand in your question: reading your props.conf and transform.conf, it seems that you want to discard all the events with sourcetype VPLATFORM_JSON, in this case why don't you change your inputs.conf?&lt;/P&gt;

&lt;P&gt;Anyway, to solve the main problem (discarding not running), I think that you followed Splunk documentation at &lt;A href="http://docs.splunk.com/Documentation/Splunk/7.0.2/Forwarding/Routeandfilterdatad" target="_blank"&gt;http://docs.splunk.com/Documentation/Splunk/7.0.2/Forwarding/Routeandfilterdatad&lt;/A&gt; .&lt;/P&gt;

&lt;P&gt;To discard only specific events, I usually use two stanzas, something like this:&lt;BR /&gt;
in &lt;STRONG&gt;props.conf&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[source::/var/log/messages]
TRANSFORMS-set= setparsing, setnull
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;in &lt;STRONG&gt;transforms.conf&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[setnull]
REGEX = my_regex
DEST_KEY = queue
FORMAT = nullQueue

[setparsing]
REGEX = .
DEST_KEY = queue
FORMAT = indexQueue
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 18:14:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-is-nullQueue-log-discard-not-working/m-p/330355#M61248</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2020-09-29T18:14:52Z</dc:date>
    </item>
    <item>
      <title>Re: nullQueue : log discard not working</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-is-nullQueue-log-discard-not-working/m-p/330356#M61249</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;try using setnull in props.conf :&lt;BR /&gt;
    TRANSFORMS-null = setnull&lt;/P&gt;

&lt;P&gt;And in transforms.conf:&lt;BR /&gt;
    [setnull]&lt;BR /&gt;
     REGEX = .&lt;BR /&gt;
     DEST_KEY = queue&lt;BR /&gt;
     FORMAT = nullQueue&lt;/P&gt;</description>
      <pubDate>Tue, 06 Mar 2018 08:55:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-is-nullQueue-log-discard-not-working/m-p/330356#M61249</guid>
      <dc:creator>p_gurav</dc:creator>
      <dc:date>2018-03-06T08:55:43Z</dc:date>
    </item>
    <item>
      <title>Re: nullQueue : log discard not working</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-is-nullQueue-log-discard-not-working/m-p/330357#M61250</link>
      <description>&lt;P&gt;Hi Giuseppe,&lt;/P&gt;

&lt;P&gt;Thanks for your relply.&lt;/P&gt;

&lt;P&gt;Regarding your answer specifically :&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Indexed extractions&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;&lt;EM&gt;"indexed extractions are the only situation where you need to deploy props.conf and transforms.conf also in Universal Forwarder, and not only on Indexers"&lt;/EM&gt;&lt;/P&gt;

&lt;P&gt;I was really surprised to read this, as nearly all the posts I have read so far mention that these files are &lt;EM&gt;not even processed&lt;/EM&gt; by the universal forwarder. &lt;/P&gt;

&lt;P&gt;If this is wrong, then it would explain why my transform is not working &lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Discard&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;Regarding the discard rule specifically, I understand you were surprised to see that I want to discard &lt;STRONG&gt;all the vents&lt;/STRONG&gt;, but this is just to emphasize the fact that the &lt;STRONG&gt;discard isn't working as intended&lt;/STRONG&gt; ( the goal is indeed to discard only a few entries in the end, but first I need to get it working properly )&lt;/P&gt;</description>
      <pubDate>Tue, 06 Mar 2018 09:38:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-is-nullQueue-log-discard-not-working/m-p/330357#M61250</guid>
      <dc:creator>craymore</dc:creator>
      <dc:date>2018-03-06T09:38:06Z</dc:date>
    </item>
    <item>
      <title>Re: nullQueue : log discard not working</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-is-nullQueue-log-discard-not-working/m-p/330358#M61251</link>
      <description>&lt;P&gt;Hello !&lt;/P&gt;

&lt;P&gt;This is exactly what I did ( except for the * in the regex which isn't necessary ), as indicated in the main post, but it isn't working&lt;/P&gt;</description>
      <pubDate>Tue, 06 Mar 2018 09:47:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-is-nullQueue-log-discard-not-working/m-p/330358#M61251</guid>
      <dc:creator>craymore</dc:creator>
      <dc:date>2018-03-06T09:47:26Z</dc:date>
    </item>
    <item>
      <title>Re: nullQueue : log discard not working</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-is-nullQueue-log-discard-not-working/m-p/330359#M61252</link>
      <description>&lt;P&gt;Hi craymore,&lt;BR /&gt;
a clarification: &lt;BR /&gt;
discard filters are always enabled on Indexers, &lt;BR /&gt;
instead sourcetype specifications are defined on Universal Forwarders when you have indexed extractions.&lt;BR /&gt;
This means that the discard problem isn't related to the position of discard filters.&lt;BR /&gt;
I think that the first thing is to test the filtering regex.&lt;BR /&gt;
To do this you can use Splunk itself (rex command).&lt;BR /&gt;
When you'll sure of your regex, choose is you have to discard some events and take all the otheres ot to take some events and discard the others.&lt;BR /&gt;
Thisis importanto in the props.conf and transforms.conf definition:&lt;BR /&gt;
if you have to discard some events and take all the others, you can use my above configurations;&lt;BR /&gt;
if instead your have to take some events and discard all the others use the following configurations:&lt;BR /&gt;
props.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[source::/var/log/messages]
TRANSFORMS-set= setnull, setparsing
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;transforms.conf.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; [setnull]
 REGEX = .
 DEST_KEY = queue
 FORMAT = nullQueue

 [setparsing]
 REGEX = my_regex
 DEST_KEY = queue
 FORMAT = indexQueue
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;In few words:&lt;BR /&gt;
in props.conf, the order of stanzas is:&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;before the all events stanza,&lt;/LI&gt;
&lt;LI&gt;then the filtering stanza.
If you want, share the regex for filtering and an example to test it.&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Tue, 06 Mar 2018 10:47:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-is-nullQueue-log-discard-not-working/m-p/330359#M61252</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2018-03-06T10:47:08Z</dc:date>
    </item>
  </channel>
</rss>

