Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

searching with clp-s for json log fields containing words with spaces is not working #284

Open
bb-rajakarthik opened this issue Feb 14, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@bb-rajakarthik
Copy link

Bug

I have compressed json logs using clp-s which look like the following:
{"level": "INFO", "message": "Fetched Profile of user 1"}
{"level": "INFO", "message": "Fetched Profile of user 2"}
{"level": "INFO", "message": "Unable to fetch Profile of user 3"}

and when I want to search on the archive generated after compression, I'm using the following command:
clp-s s /archives/9aa85aaa-72f8-4b7f-9c24-baf015dd2566 "message: Fetched Profile"*

which is leading me to the following error:
_line 1:15 extraneous input 'Profile' expecting
Parser Error
2024-02-14T07:42:49.121+00:00 [error] Query 'message: Fetch Profile
' is logically false_**

Am I doing something wrong in writing the search query? Ideally, the above query should filter out the first 2 lines from the archive.

CLP version

7de16f9

Environment

ubuntu 22.04

Reproduction steps

create a file with the 3 logs mentioned above and run the following command to compress:
clp-s c /tmp sample.log

Now run search on the archive generated from the above command:
clp-s s /tmp/654f1911-fc44-4a39-9459-7577568a4d49/ "message: Fetched Profile*"

@bb-rajakarthik bb-rajakarthik added the bug Something isn't working label Feb 14, 2024
@kirkrodrigues
Copy link
Member

Hey @bb-rajakarthik, thanks for the report. In our flavour of KQL, values with spaces need to be quoted (with ") otherwise the parser thinks Profile* is another term. Can you try this?

clp-s s /tmp/654f1911-fc44-4a39-9459-7577568a4d49/ 'message: "Fetched Profile*"'

We'll update the docs to clarify this.

Also, you can update to the latest version of clp-s since we've fixed some bugs. 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants