Splunk Search

Error in 'search' command: Unable to parse the search: Right hand side of IN must be a collection of literals?

buttsurfer
Path Finder

 

index=index1 type=1 feature IN ([search index=index1 type=type2 application=weather_app
    | dedup feature
    | fields feature
    | format
    ])

 

 

The above code returns this error and i cant seem to figure out how to fix it. Any help would be appreciated

Error in 'search' command: Unable to parse the search: Right hand side of IN must be a collection of literals. '((feature = "feature1") OR (feature = "feature2") OR (feature = "feature3") OR (feature = "feature4") is not a literal.

Labels (2)
0 Karma
1 Solution

buttsurfer
Path Finder

Fixed it by adding 

 

          | dedup feature
          | fields feature
          | format "" "" "" "" "," ""
          | eval search=replace (search, "feature=", "")

 

View solution in original post

0 Karma

buttsurfer
Path Finder

Fixed it by adding 

 

          | dedup feature
          | fields feature
          | format "" "" "" "" "," ""
          | eval search=replace (search, "feature=", "")

 

0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @buttsurfer,

you can also use this easier solution:

index=index1 type=1 [search index=index1 type=type2 application=weather_app | rename feature AS query | fields query ]
| ...

Ciao.

Giuseppe

0 Karma
Get Updates on the Splunk Community!

Introducing the Splunk Community Dashboard Challenge!

Welcome to Splunk Community Dashboard Challenge! This is your chance to showcase your skills in creating ...

Built-in Service Level Objectives Management to Bridge the Gap Between Service & ...

Wednesday, May 29, 2024  |  11AM PST / 2PM ESTRegister now and join us to learn more about how you can ...

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

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