Validate Logstash pipeline ID when creating. #135378
Open
+81
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR change validates Logstash pipeline ID when creating a pipeline with
_logstash/pipeline/{ID}
. The ID must start with letter or underscore and can contain only letters, underscores, dashes, hyphens and numbers.It is due to consistency across the stack:
Logstash references states that pipeline ID must "begin with a letter or underscore and contain only letters, underscores, dashes, and numbers". However, when calling ES API through Kib Dev console, it still creates the pipelines. This PR addresses this issue.
Kibana mentions this in the docs, it does validate on frontend. One gap I found was Kibana API wasn't also validating pipeline ID. So, I have opened a PR to close this gap: Validates Logstash pipeline ID in Kibana API level. kibana#236347
Closes Logstash Pipeline API should enforce pipeline name restrictions #134301
How to test?
./gradlew localDistro
and run the artifact created under "build/distributions" path./_logstash/pipeline/{pipelineID}
APITemplate
gradle check
?./gradlew check
succeeded