Splunk Search

Query return value if NULL event

obiwan1129
New Member

I have a query I'm working on where not all the values I feed it are in the index I am querying against.

For example suppose I have two emails, [email protected] and [email protected]

index=windows sourcetype=ActiveDirectory [email protected] OR [email protected] | dedup name

Currently only [email protected] is in the index. As a result I only return the Event for [email protected].

I'd like to have my query return two records for [email protected] and [email protected] even if there are no results for [email protected]. Something where the event is essentially blank except for the [email protected] value

Any thoughts out there?

Tags (2)
0 Karma

DalJeanis
Legend

Use append to add a blank record for each. Look at the makeresults command for one each way to do it.

index=windows sourcetype=ActiveDirectory [email protected] OR [email protected] 
| append [
    | makeresults 
    | eval name="[email protected] [email protected]" 
    | makemv name 
    | mvexpand name 
    | table name
    ]
| dedup name
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!

Think Like an Architect: Introducing the Splunk Certified Cybersecurity Defense ...

In cybersecurity, defenders respond to threats. Architects design the systems that stop them.    As ...

Best Practices: Splunk auto adjust pipeline queue

When you enable autoAdjustQueue in Splunk, maxSize should be understood as the queue size Splunk starts with ...

Announcing Modern Navigation: A New Era of Splunk User Experience

We are excited to introduce the Modern Navigation feature in the Splunk Platform, available to both cloud and ...