Splunk Search

where and eval clause does not work with "AND" condition?

leonjxtan
Path Finder

Firstly, with below search, there are events returned:

|from datamodel foo.fooo |search Counterparty=abc TransactionType=xyz

But with below "where", it does not return any events
|from datamodel foo.fooo |where Counterparty=abc AND TransactionType=xyz

I checked WHERE document and could not get a clue what went wrong. Could you help?

Tags (1)
0 Karma
1 Solution

MuS
Legend

Can you try it like this:

  |from datamodel foo.fooo |where Counterparty="abc" AND TransactionType="xyz"

View solution in original post

0 Karma

puneethgowda
Communicator

|from datamodel foo.fooo | search Counterparty="abc" OR TransactionType="xyz"

0 Karma

MuS
Legend

This will give you the wrong results, because it is a OR search.

0 Karma

MuS
Legend

Can you try it like this:

  |from datamodel foo.fooo |where Counterparty="abc" AND TransactionType="xyz"
0 Karma

leonjxtan
Path Finder

yes worked. Thanks. So where and eval require explicit indication of strings/numbers?

0 Karma

MuS
Legend

Yes, as @woodcock mentioned where will use the right side of the = as field names because it is eval based. search on the other side will treat as strings/numbers.

Feel free to accept this answer if it solved your problem ...

cheers, MuS

0 Karma

woodcock
Esteemed Legend

Otherwise it assumes that they are field names.

0 Karma
Get Updates on the Splunk Community!

Technical Workshop Series: Splunk Data Management and SPL2 | Register here!

Hey, Splunk Community! Ready to take your data management skills to the next level? Join us for a 3-part ...

Spotting Financial Fraud in the Haystack: A Guide to Behavioral Analytics with Splunk

In today's digital financial ecosystem, security teams face an unprecedented challenge. The sheer volume of ...

Solve Problems Faster with New, Smarter AI and Integrations in Splunk Observability

Solve Problems Faster with New, Smarter AI and Integrations in Splunk Observability As businesses scale ...