opensearch-project / opensearch-project/sql

[FEATURE] PPL parse command should support substring match

Open
#2,845 3 comments 0 reactions 1 assignee View on GitHub

@songkant-aws is already working on this.

Since Jul 8, 2025.

enhancement PPL
Dominant language
Java
Stars
176
Forks
229
Avg merge
2d 21h
Merged PRs (30d)
43

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.