-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Gsub Processor Behavior and \n Sequence Issues #170904
Labels
bug
Fixes for quality problems that affect the customer experience
Feature:Ingest Node Pipelines
Ingest node pipelines management
Team:Kibana Management
Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more
Comments
fabs-elastic
added
the
bug
Fixes for quality problems that affect the customer experience
label
Nov 8, 2023
alisonelizabeth
added
the
Team:Kibana Management
Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more
label
Nov 8, 2023
Pinging @elastic/platform-deployment-management (Team:Deployment Management) |
alisonelizabeth
added
Feature:Ingest Node Pipelines
Ingest node pipelines management
needs-team
Issues missing a team label
labels
Nov 8, 2023
ElenaStoeva
added a commit
that referenced
this issue
Feb 1, 2024
…on (#175832) Fixes #170904 ## Summary This PR adds serialization to the `replacement` field in the Gsub processor edit form so that the field renders the text the way it is provided in the Es request, with unescaped special characters, if any exist. For example, we want `\n` to render the same, not to render as a new line (empty string) in the `replacement` field in the UI. ### Testing **Deserialization:** 1. Open Dev tools and create an ingest pipeline: ``` PUT _ingest/pipeline/my_pipeline_1 { "description": "My test pipeline", "processors": [ { "gsub": { "field": "message", "pattern": "\\\\n", "replacement": "\n" } }] } ``` 3. Run `GET _ingest/pipeline/my_pipeline_1` and observe the `replacement` fields (should be displayed as a new line). 4. Go to Stack Management -> Ingest Pipelines and start editing `my_pipeline_1`. The `replacement` field in the edit form should render as `\n` instead of an empty string. **Serialization:** 1. Go to Stack Management -> Ingest Pipelines and create a new pipeline `my_pipeline_2` with a Gsub processor on the field `message`, pattern: `\\\\n`, and replacement: `\n`. Save the pipeline 2. Go to Dev tools and get the pipeline: `GET _ingest/pipeline/my_pipeline_2`. The `replacement` field in the response should be displayed as a new line: ``` { "my_pipeline": { "description": "My test pipeline", "processors": [ { "gsub": { "field": "message", "pattern": """\\n""", "replacement": """ """ } } ] } } ``` 3. Edit the pipeline in the UI and change the `replacement` field to `\\n`. 4. Now the response in Dev tools should display `\n` (the new line character was escaped). You can also test with other escape characters. For example, creating a pipeline with a `my\ttab` replacement field in the UI should display `my tab` in the response.
fkanout
pushed a commit
to fkanout/kibana
that referenced
this issue
Feb 7, 2024
…on (elastic#175832) Fixes elastic#170904 ## Summary This PR adds serialization to the `replacement` field in the Gsub processor edit form so that the field renders the text the way it is provided in the Es request, with unescaped special characters, if any exist. For example, we want `\n` to render the same, not to render as a new line (empty string) in the `replacement` field in the UI. ### Testing **Deserialization:** 1. Open Dev tools and create an ingest pipeline: ``` PUT _ingest/pipeline/my_pipeline_1 { "description": "My test pipeline", "processors": [ { "gsub": { "field": "message", "pattern": "\\\\n", "replacement": "\n" } }] } ``` 3. Run `GET _ingest/pipeline/my_pipeline_1` and observe the `replacement` fields (should be displayed as a new line). 4. Go to Stack Management -> Ingest Pipelines and start editing `my_pipeline_1`. The `replacement` field in the edit form should render as `\n` instead of an empty string. **Serialization:** 1. Go to Stack Management -> Ingest Pipelines and create a new pipeline `my_pipeline_2` with a Gsub processor on the field `message`, pattern: `\\\\n`, and replacement: `\n`. Save the pipeline 2. Go to Dev tools and get the pipeline: `GET _ingest/pipeline/my_pipeline_2`. The `replacement` field in the response should be displayed as a new line: ``` { "my_pipeline": { "description": "My test pipeline", "processors": [ { "gsub": { "field": "message", "pattern": """\\n""", "replacement": """ """ } } ] } } ``` 3. Edit the pipeline in the UI and change the `replacement` field to `\\n`. 4. Now the response in Dev tools should display `\n` (the new line character was escaped). You can also test with other escape characters. For example, creating a pipeline with a `my\ttab` replacement field in the UI should display `my tab` in the response.
CoenWarmer
pushed a commit
to CoenWarmer/kibana
that referenced
this issue
Feb 15, 2024
…on (elastic#175832) Fixes elastic#170904 ## Summary This PR adds serialization to the `replacement` field in the Gsub processor edit form so that the field renders the text the way it is provided in the Es request, with unescaped special characters, if any exist. For example, we want `\n` to render the same, not to render as a new line (empty string) in the `replacement` field in the UI. ### Testing **Deserialization:** 1. Open Dev tools and create an ingest pipeline: ``` PUT _ingest/pipeline/my_pipeline_1 { "description": "My test pipeline", "processors": [ { "gsub": { "field": "message", "pattern": "\\\\n", "replacement": "\n" } }] } ``` 3. Run `GET _ingest/pipeline/my_pipeline_1` and observe the `replacement` fields (should be displayed as a new line). 4. Go to Stack Management -> Ingest Pipelines and start editing `my_pipeline_1`. The `replacement` field in the edit form should render as `\n` instead of an empty string. **Serialization:** 1. Go to Stack Management -> Ingest Pipelines and create a new pipeline `my_pipeline_2` with a Gsub processor on the field `message`, pattern: `\\\\n`, and replacement: `\n`. Save the pipeline 2. Go to Dev tools and get the pipeline: `GET _ingest/pipeline/my_pipeline_2`. The `replacement` field in the response should be displayed as a new line: ``` { "my_pipeline": { "description": "My test pipeline", "processors": [ { "gsub": { "field": "message", "pattern": """\\n""", "replacement": """ """ } } ] } } ``` 3. Edit the pipeline in the UI and change the `replacement` field to `\\n`. 4. Now the response in Dev tools should display `\n` (the new line character was escaped). You can also test with other escape characters. For example, creating a pipeline with a `my\ttab` replacement field in the UI should display `my tab` in the response.
fkanout
pushed a commit
to fkanout/kibana
that referenced
this issue
Mar 4, 2024
…on (elastic#175832) Fixes elastic#170904 ## Summary This PR adds serialization to the `replacement` field in the Gsub processor edit form so that the field renders the text the way it is provided in the Es request, with unescaped special characters, if any exist. For example, we want `\n` to render the same, not to render as a new line (empty string) in the `replacement` field in the UI. ### Testing **Deserialization:** 1. Open Dev tools and create an ingest pipeline: ``` PUT _ingest/pipeline/my_pipeline_1 { "description": "My test pipeline", "processors": [ { "gsub": { "field": "message", "pattern": "\\\\n", "replacement": "\n" } }] } ``` 3. Run `GET _ingest/pipeline/my_pipeline_1` and observe the `replacement` fields (should be displayed as a new line). 4. Go to Stack Management -> Ingest Pipelines and start editing `my_pipeline_1`. The `replacement` field in the edit form should render as `\n` instead of an empty string. **Serialization:** 1. Go to Stack Management -> Ingest Pipelines and create a new pipeline `my_pipeline_2` with a Gsub processor on the field `message`, pattern: `\\\\n`, and replacement: `\n`. Save the pipeline 2. Go to Dev tools and get the pipeline: `GET _ingest/pipeline/my_pipeline_2`. The `replacement` field in the response should be displayed as a new line: ``` { "my_pipeline": { "description": "My test pipeline", "processors": [ { "gsub": { "field": "message", "pattern": """\\n""", "replacement": """ """ } } ] } } ``` 3. Edit the pipeline in the UI and change the `replacement` field to `\\n`. 4. Now the response in Dev tools should display `\n` (the new line character was escaped). You can also test with other escape characters. For example, creating a pipeline with a `my\ttab` replacement field in the UI should display `my tab` in the response.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
bug
Fixes for quality problems that affect the customer experience
Feature:Ingest Node Pipelines
Ingest node pipelines management
Team:Kibana Management
Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more
Kibana version: 8.10.4
Elasticsearch version: 8.10.4
Server OS version:
Browser version: Google Chrome Version 119.0.6045.105
Browser OS version: Mac OS Sonoma 14.1.1
Original install method (e.g. download page, yum, from source, etc.): Download page
Describe the bug:
An Ingest Pipeline was created using the Kibana Dev Tools with a Gsub processor intended to replace newline characters.
When checked in the Kibana Console, the \n sequence wasn't displayed as expected, as shown in the attached screenshot (ingest_pipeline_00.png).
Steps to reproduce:
PUT _ingest/pipeline/my_pipeline { "description": "My test pipeline", "processors": [ { "gsub": { "field": "message", "pattern": "\\\\n", "replacement": "\n" } } ] }
The text was updated successfully, but these errors were encountered: