Getting Data In

Blacklisting DNS queries with nullQueue

geoffmx
Explorer

I am attempting to blacklist DNS queries using nullQueue.

props.conf

# Blacklist domains
[msad:nt6:dns]
TRANSFORMS-blacklistdomain01 = bl_subdom_domain01_com
TRANSFORMS-blacklistdomain02 = bl_domain02_com

transforms.conf

[bl_subdom_domain01_com]
REGEX=query=subdom.domain01.com
DEST_KEY=queue
FORMAT=nullQueue

[bl_domain02_com]
REGEX=query=domain02.com
DEST_KEY=queue
FORMAT=nullQueue

This does not work! Is there something wrong with the syntax I've used?

0 Karma

jeremyhagand61
Communicator

Since you are dropping the file before indexing, your regex needs to match the syntax of the raw event data, not the formatted data.

So if your domain you want to drop is company.com, this will look something like this in the logs:

(3)company(2)com(0)

So you may want to have a regex like this:

\(\d\)company\(\d\)com
0 Karma

geoffmx
Explorer

None of this works, unfortunately. I wonder if I am editing the .conf files in the correct location.

In the splunk etc directory, there are two folders for DNS:

$SPLUNK_HOME/etc/apps/TA-DNSServer-NT6/local, and
$SPLUNK_HOME/etc/deployment-apps/Splunk_TA_microsoft_dns/local

Is there a way to determine the right app directory for a given sourcetype?

0 Karma

nick405060
Motivator

etc/deployment-apps is only for apps that you are pushing out to ufs from a deployment server

so you need to be doing this in the etc/apps directory on your indexer or search head; for your question specifically that's indexer

the directory inside of /etc/apps doesn't matter as much, as long as it's in a local directory, since it's a configuration hierarchy (see btool)

0 Karma

vinod94
Contributor

dyude @geoffmx ,

Can you try this,

props.conf

[msad:nt6:dns]
TRANSFORMS-set= domain1,domain2

transforms.conf

[domain1]
REGEX = query\=subdom\.domain01\.com
DEST_KEY = queue
FORMAT = nullQueue

[domain2]
REGEX = query\=domain02\.com
DEST_KEY = queue
FORMAT = nullQueue

Llet me know if it works for you!

0 Karma

geoffmx
Explorer

I'm not having any luck with this. The nullQueue method did not work. I've even tried blacklisting the domain in inputs.conf

[MSAD:NT6:DNS]
disabled=false
index=msad
blacklist1 = query="domain01\.com"

Escaping the [.] character does not seem to have any effect.

0 Karma

nick405060
Motivator

Is your sourcetype of msad:nt6:dns correct in props?

Here is what I set up yesterday:

me@local$ cat props.conf
[WebViewIIS]
TRANSFORMS-set = setnull_webview,setparsing_webview
me@local$ cat transforms.conf
[setnull_webview]
REGEX = .
DEST_KEY = queue
FORMAT = nullQueue

[setparsing_webview]
REGEX = (?i)mycompany-domain
DEST_KEY = queue
FORMAT = indexQueue
0 Karma

geoffmx
Explorer
0 Karma

jaime_ramirez
Communicator

Hi

You must escape the [.] character:

[bl_subdom_domain01_com]
REGEX= query=subdom\.domain01\.com
DEST_KEY=queue
FORMAT=nullQueue

[bl_domain02_com]
REGEX= query=domain02\.com
DEST_KEY=queue
FORMAT=nullQueue

Hope it helps

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Why Splunk Customers Should Attend Cisco Live 2026 Las Vegas

Why Splunk Customers Should Attend Cisco Live 2026 Las Vegas     Cisco Live 2026 is almost here, and this ...

What Is the Name of the USB Key Inserted by Bob Smith? (BOTS Hint, Not the Answer)

Hello Splunkers,   So you searched, “what is the name of the usb key inserted by bob smith?”  Not gonna lie… ...

Automating Threat Operations and Threat Hunting with Recorded Future

    Automating Threat Operations and Threat Hunting with Recorded Future June 29, 2026 | Register   Is your ...