Splunk Search

Why is my search producing error "Error in 'eval' command: The expression is malformed..."?

TheJagoff
Communicator

When I enter this search:

sourcetype=win*
(EventCode=4624 OR EventCode=4634)| stats latest(eval(if(EventCode=4624,_time, null()))) as logon_time, latest(eval(if(EventCode=4634,_time,null()))) as logoff_time by User
| eval logoff_time = if(logoff_time < logon_time OR isnull(logoff_time), “Session in Progress”, logoff_time)

I get the error:

Error in 'eval' command: The expression is malformed. An unexpected character is reached at '“Session in Progress”, logoff_time)'.

I can't seem to see where I messed up. Any help or ideas are most appreciated.

Thanks

0 Karma
1 Solution

woodcock
Esteemed Legend

It is almost certainly because you are using Windows/handed/slanted double-quotes (“ ”) instead of low-ASCII/unhanded ("). Cut and paste THIS ONE -> ".

View solution in original post

woodcock
Esteemed Legend

It is almost certainly because you are using Windows/handed/slanted double-quotes (“ ”) instead of low-ASCII/unhanded ("). Cut and paste THIS ONE -> ".

TheJagoff
Communicator

As usual - you are absolutely correct sir. Many many thanks!

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Community Content Calendar, September edition

Welcome to another insightful post from our Community Content Calendar! We're thrilled to continue bringing ...

Splunkbase Unveils New App Listing Management Public Preview

Splunkbase Unveils New App Listing Management Public PreviewWe're thrilled to announce the public preview of ...

Leveraging Automated Threat Analysis Across the Splunk Ecosystem

Are you leveraging automation to its fullest potential in your threat detection strategy?Our upcoming Security ...