Splunk Search

Error in 'eval' command: The expression is malformed. An unexpected character is reached

sarathipattam
New Member

I was getting when I run the below query, can someone give me the solution pls,

below is my query:

| convert num(actualTimeExtract) as actualTime
|eval buckt=case (
actualTime<1001, “time < 1 sec”,
actualTime>1000 AND actualTime<5001, “1 < time < 5”,
1=1, “time > 15”)
|stats dc(hdr.macaddress) by buckt

0 Karma

MuS
SplunkTrust
SplunkTrust

Hi sarathipattam,

this is most likely a copy/paste problem, you have instead of ". Try the run everywhere search below to see how it works:

| makeresults 
| eval actualTime="1000" 
| eval buckt=case (
    actualTime<1001, "time < 1 sec", 
    actualTime>1000 AND actualTime<5001, "1 < time < 5", 
    1=1, "time > 15")

Hope this helps ...

cheers, MuS

niketn
Legend

@MuS, it was only yesterday that @xpac and I spoke of the devil 😄

https://answers.splunk.com/answers/659050/unicode-characters-in-dashboardssearches.html#answer-65905...

____________________________________________
| makeresults | eval message= "Happy Splunking!!!"
Get Updates on the Splunk Community!

Strengthen Your Future: A Look Back at Splunk 10 Innovations and .conf25 Highlights!

The Big One: Splunk 10 is Here!  The moment many of you have been waiting for has arrived! We are thrilled to ...

Now Offering the AI Assistant Usage Dashboard in Cloud Monitoring Console

Today, we’re excited to announce the release of a brand new AI assistant usage dashboard in Cloud Monitoring ...

Stay Connected: Your Guide to October Tech Talks, Office Hours, and Webinars!

What are Community Office Hours? Community Office Hours is an interactive 60-minute Zoom series where ...