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!

Quick connection discovery mode for forwarders

When a Splunk forwarder loses connectivity to its indexers, it does not always reconnect immediately. In many ...

Build and Launch AI Agents from Your Splunk Workflows

  Register We’ve all been there: juggling alerts, runbooks, and endless manual searches. What if you could ...

Splunk Cloud Application Management in Terraform

Register   On Tuesday, August 4 at 11AM PDT / 2PM EDT, we’re diving into how you can bring Infrastructure as ...