Splunk Search

Problem of mismatched quotes and/or parenthesis says splunk but not my editor...

mehdiazmi
Explorer

Hello everyone!

when I'am performing that search :

| inputlookup table-vuln-machin.csv | chart eval( count ( eval [ search index=qualys_truc_hosts | dedup HOST.IP | stats dc(HOST.IP)] - count( eval [| inputlookup table-vuln-machin.csv | dedup IP | stats dc(IP)] ) ) )

I am getting this answer :

Error in 'SearchProcessor': Mismatched quotes and/or parenthesis.

After I have copied and pasted it in my editor, I see no mismatching quote or parenthesis.

All the indexes and inputlookups are working fine on other searches.

Could you explain me why?

Thank you

Tags (2)
0 Karma
1 Solution

somesoni2
Revered Legend

Try this

| inputlookup table-vuln-machin.csv | stats dc(IP) s count2 | eval difference=[ search index=qualys_truc_hosts | stats dc(HOST.IP) as search]-count2

View solution in original post

somesoni2
Revered Legend

Try this

| inputlookup table-vuln-machin.csv | stats dc(IP) s count2 | eval difference=[ search index=qualys_truc_hosts | stats dc(HOST.IP) as search]-count2

mehdiazmi
Explorer

Thank you.
I did it in another way but your solution works too.

Thanks again and have a nice day.

0 Karma

richgalloway
SplunkTrust
SplunkTrust

I suspect the error message is inaccurate, something I've noticed before. I also can't say I've seen searches within an eval before so I wonder if that is the source of the error. Consider rewriting your search something like this:

index=qualys_truc_hosts | dedup HOST.IP | stats dc(HOST.IP) as hostCount | appendcols [| inputlookup table-vuln-machin.csv | dedup IP | stats dc(IP) as IPcount]  | chart count(eval hostCount-IPcount)
---
If this reply helps you, Karma would be appreciated.

mehdiazmi
Explorer

Thank you for your help.

Unfortunately, it's not working. I'll try another way.

Once again, thank you.

0 Karma

chimell
Motivator

What do you want to do?
It is better to change the way to write request
Just tell the thing that you want to do

0 Karma
Get Updates on the Splunk Community!

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

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...