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

[FEATURE] PPL parse command should support substring match #2845

Open
penghuo opened this issue Jul 19, 2024 · 1 comment
Open

[FEATURE] PPL parse command should support substring match #2845

penghuo opened this issue Jul 19, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@penghuo
Copy link
Collaborator

penghuo commented Jul 19, 2024

Is your feature request related to a problem?

PUT my-index-000001/_doc/1
{ "log": "response {200 map {\"code\":\"449\",\"msg\":\"session has expired\"} false}\n" }
 
### no match
POST _plugins/_ppl
{
  "query": """
  source = my-index-000001 | WHERE match(log, "response") | parse lambdalog 'msg\":\"(?<msg>[^\"]+)' | fields msg;
  """
}

### matched
POST _plugins/_ppl
{
  "query": """
  source = my-index-000001 | WHERE match(log, "response") | parse lambdalog '.+msg\":\"(?<msg>[^\"]+).*\n?' | fields msg;
  """
}

What solution would you like?
Currently, parse using matcher.matches which requried the regex match the entire string.

We can consider change to matcher.find to match substring.

More reading, https://stackoverflow.com/questions/4450045/difference-between-matches-and-find-in-java-regex

What alternatives have you considered?
A clear and concise description of any alternative solutions or features you've considered.

Do you have any additional context?
Add any other context or screenshots about the feature request here.

@penghuo penghuo added enhancement New feature or request untriaged labels Jul 19, 2024
@dblock dblock removed the untriaged label Aug 12, 2024
@dblock
Copy link
Member

dblock commented Aug 12, 2024

[Catch All Triage - 1, 2, 3]]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants