Skip to content

Conversation

mashhurs
Copy link
Contributor

@mashhurs mashhurs commented Sep 24, 2025

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:

How to test?

  • pull this change
  • run with Kibana if you would like, guide is here. See the following screenshot which I tested locally to check user experience.
  • alternatively, run elasticsearch after compile: the fastest way is to create local distro ./gradlew localDistro and run the artifact created under "build/distributions" path.
  • call /_logstash/pipeline/{pipelineID} API
curl --location --request PUT 'https://127.0.0.1:9200/_logstash/pipeline/1main' \
        --header 'Authorization: ••••••' \
        --data ''
      {
          "error": {
              "root_cause": [
                  {
                      "type": "illegal_argument_exception",
                      "reason": "invalid pipeline id [1main]: must begin with a letter or underscore, can contain only letters, underscores, dashes, and numbers"
                  }
              ],
              "type": "illegal_argument_exception",
              "reason": "invalid pipeline id [1main]: must begin with a letter or underscore, can contain only letters, underscores, dashes, and numbers"
          },
          "status": 400
      }
Screenshot 2025-09-24 at 9 51 47 AM

Template

  • Have you signed the contributor license agreement? - Y
  • Have you followed the contributor guidelines? - Y
  • If submitting code, have you built your formula locally prior to submission with gradle check?
    • ./gradlew check succeeded
  • If submitting code, is your pull request against main? Unless there is a good reason otherwise, we prefer pull requests against main and will backport as needed.
  • If submitting code, have you checked that your submission is for an OS and architecture that we support?
  • If you are submitting this code for a class then read our policy for that.

@mashhurs mashhurs self-assigned this Sep 24, 2025
@mashhurs mashhurs added >bug Team:Logstash Logstash team labels Sep 24, 2025
@elasticsearchmachine elasticsearchmachine added v9.2.0 external-contributor Pull request authored by a developer outside the Elasticsearch team labels Sep 24, 2025
@mashhurs mashhurs added the auto-backport Automatically create backport pull requests when merged label Sep 24, 2025
@mashhurs mashhurs added the :Core/Infra/Plugins Plugin API and infrastructure label Sep 24, 2025
@elasticsearchmachine elasticsearchmachine added the Team:Core/Infra Meta label for core/infra team label Sep 24, 2025
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra (Team:Core/Infra)

@mashhurs mashhurs removed the :Core/Infra/Plugins Plugin API and infrastructure label Sep 24, 2025
@elasticsearchmachine elasticsearchmachine removed the Team:Core/Infra Meta label for core/infra team label Sep 24, 2025
@mashhurs mashhurs requested a review from a team September 24, 2025 20:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-backport Automatically create backport pull requests when merged >bug external-contributor Pull request authored by a developer outside the Elasticsearch team :Logstash/CPM Team:Logstash Logstash team v9.2.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Logstash Pipeline API should enforce pipeline name restrictions
2 participants