Splunk Search

Problem with a macro

fdevera
Path Finder

`get_seclabel(host,"domain_controller","-90d")`

Macro expanded:

| inputlookup sec_label where (label="domain_controller" type="host" last_updated>=1585079881.000000)

 

In the input lookup there are the following columns: label, type, and value. The results of this lookup give me everything that is a domain controller.  I'm trying to exclude anything that matches in the value column so I'm using this in a search but it's not excluding the list properly:

NOT
[| `get_seclabel(host,"domain_controller","-90d")`

I still see NADC01 as a returned value in my search even though I'm excluding it here. Any idea what I'm doing wrong?

Labels (1)
0 Karma
1 Solution

anilchaithu
Builder

@fdevera 

I assume you are using the inputlookup as subsearch. Please output the field required from the lookup like here

NOT
[| `get_seclabel(host,"domain_controller","-90d")` | fileds value ]

and match the field name to the field name in main search. If it is host, rename value to host

NOT
[| `get_seclabel(host,"domain_controller","-90d")` | fileds value |  rename value as host]

 

Hope this helps

View solution in original post

anilchaithu
Builder

@fdevera 

I assume you are using the inputlookup as subsearch. Please output the field required from the lookup like here

NOT
[| `get_seclabel(host,"domain_controller","-90d")` | fileds value ]

and match the field name to the field name in main search. If it is host, rename value to host

NOT
[| `get_seclabel(host,"domain_controller","-90d")` | fileds value |  rename value as host]

 

Hope this helps

anilchaithu
Builder

if this helps an upvote would be appreciated

Get Updates on the Splunk Community!

More Ways To Control Your Costs With Archived Metrics | Register for Tech Talk

Tuesday, May 14, 2024  |  11AM PT / 2PM ET Register to Attend Join us for this Tech Talk and learn how to ...

.conf24 | Personalize your .conf experience with Learning Paths!

Personalize your .conf24 Experience Learning paths allow you to level up your skill sets and dive deeper ...

Threat Hunting Unlocked: How to Uplevel Your Threat Hunting With the PEAK Framework ...

WATCH NOWAs AI starts tackling low level alerts, it's more critical than ever to uplevel your threat hunting ...