Splunk Search

Is it possible to use where command in Data Model?

wilhelmF
Path Finder

I have datamodel and I want to create a child datamodel based on a field comparison. In a normal search I would use a where command but in the constraints I only can use a search command. My question is there a way to do it without an eval expression in a field?

0 Karma

Yunagi
Communicator

How about you create a calculated field under Settings/Fields? Something like:

Name: match
Eval expression: if(field1==field2,"yes","no")

Then you can create your child datamodel based on the constraint:

match="yes"

DalJeanis
SplunkTrust
SplunkTrust

@Yunagi - This is a correct way to go about this, although it does not meet OP's requirement of not having an eval in a field.

@wilhelmf - Not sure what your reason for not wanting the eval field. If you are just worrying about complicating the data model from a user's point of view, then you can hide the calculated field.

0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...