Splunk Search

Error in 'where' command: The expression is malformed. Expected ).

sumarri
Path Finder

So I am creating a dashboard and I keep getting this error: 

Error in 'where' command: The expression is malformed. Expected ).

This is what I have:

| loadjob savedsearch="name:search:cust_info"
| where AccountType IN ($AccountType$)

 

I created a multiselect filter on AccountType and I want the SPL to query on those selected. 

What could I be missing or another way to achieve this query to filter on AccountType?

Labels (1)
0 Karma
1 Solution

sumarri
Path Finder

I have soled the issue. 

 

I needed to add quotes to the AccountType:

| where AccountType IN ("$AccountType$")

 

I also needed to change the delimiter:

<delimiter>,</delimiter>

 

This solved the problem for me! Thank you!

View solution in original post

sumarri
Path Finder

I have soled the issue. 

 

I needed to add quotes to the AccountType:

| where AccountType IN ("$AccountType$")

 

I also needed to change the delimiter:

<delimiter>,</delimiter>

 

This solved the problem for me! Thank you!

richgalloway
SplunkTrust
SplunkTrust

The IN operator only works in the search command.  In where you must use the in function.

| loadjob savedsearch="name:search:cust_info"
| where in(AccountType,$AccountType$)

 

---
If this reply helps you, Karma would be appreciated.

sumarri
Path Finder

Hey! I still get the same error. But thank you for trying! Let me know if something else clicks. Thank you.

0 Karma

richgalloway
SplunkTrust
SplunkTrust

What does the $AccountType$ token expand to?

---
If this reply helps you, Karma would be appreciated.

sumarri
Path Finder

So, it is expected to get the AccountTypes selected from the user on the dashboard from the multiselect filter. 

0 Karma
Get Updates on the Splunk Community!

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer at Splunk .conf24 ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...

Share Your Ideas & Meet the Lantern team at .Conf! Plus All of This Month’s New ...

Splunk Lantern is Splunk’s customer success center that provides advice from Splunk experts on valuable data ...

Combine Multiline Logs into a Single Event with SOCK: a Step-by-Step Guide for ...

Combine multiline logs into a single event with SOCK - a step-by-step guide for newbies Olga Malita The ...