Splunk Search

How to get this eval statement to isolate the search to just two values?

msage
Path Finder

Working on a search where there's a field (Office Location) with about 5 different values that are stored in a lookup file. We're looking at attendance at a specific office (office 1) and differentiating who's actually going in. Specifically, we want to isolate people assigned to office 1 and those that are assigned to a different office. The original search looks like this but it would populate all the locations rather than just office 1 or not.

 

index=index EVDESCR="event" READERDESC="reader"
| lookup users.csv ID as EMPLOYEE_ID 
|timechart span=1d dc(CARDNUM) by Location limit=0

 

 

I tried using this eval statement to hopefully isolate the search to just two values. Yes, home office or no home office. 

 

 

|eval Home=if(Location"office1", yes, no) 

 

 

 The problem is this eval statement doesn't work and I'm not sure what I'm doing wrong. Any help is appreciated. 

Labels (4)
1 Solution

ITWhisperer
SplunkTrust
SplunkTrust
| eval Home=if(Location="office1", "yes", "no") 

View solution in original post

ITWhisperer
SplunkTrust
SplunkTrust
| eval Home=if(Location="office1", "yes", "no") 

msage
Path Finder

Actually you were correct. Not having the quotation marks was what was giving me issues. 

0 Karma

msage
Path Finder

Tried that and it won't work for whatever reason. All the results are blank

0 Karma
Get Updates on the Splunk Community!

[Puzzles] Solve, Learn, Repeat: Reprocessing XML into Fixed-Length Events

This challenge was first posted on Slack #puzzles channelFor a previous puzzle, I needed a set of fixed-length ...

Data Management Digest – December 2025

Welcome to the December edition of Data Management Digest! As we continue our journey of data innovation, the ...

Index This | What is broken 80% of the time by February?

December 2025 Edition   Hayyy Splunk Education Enthusiasts and the Eternally Curious!    We’re back with this ...