opensearch-project / opensearch-project/data-prepper

[BUG] Data Prepper strings do not support $

Open
#4,772 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Java
Stars
374
Forks
354
Avg merge
3d 18h
Merged PRs (30d)
8

Description

Describe the bug

Strings in Data Prepper do not allow a $ character. This can be problematic for any situation, but especially when using a regex pattern to get the end of a line.

To Reproduce

Create a pipeline with a route like:

/some_field =~ "^prefix-[a-zA-Z0-9-]+$"

Run Data Prepper.

You will get some cryptic errors.

Caused by: org.opensearch.dataprepper.expression.ExceptionOverview: Multiple exceptions (37)
|-- org.antlr.v4.runtime.LexerNoViableAltException: null
    at org.antlr.v4.runtime.atn.LexerATNSimulator.failOrAccept(LexerATNSimulator.java:309)
|-- org.antlr.v4.runtime.InputMismatchException: null
    at org.antlr.v4.runtime.DefaultErrorStrategy.sync(DefaultErrorStrategy.java:270)

Change the regex by removing the $. The route works as expected.

Expected behavior

I should be able to run Data Prepper with $ in the strings.

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.

Research direction

Start by reproducing the Data Prepper pipeline route shown in the issue and trace the route expression parsing that produces the lexer errors. Confirm the affected expression-string handling, then verify that the same regex containing $ runs successfully without errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.