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
Copy link
Member

@robbavey robbavey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mashhurs mashhurs merged commit 9b9e665 into elastic:main Sep 26, 2025
34 checks passed
@mashhurs mashhurs deleted the validate-logstash-pipeline-id branch September 26, 2025 22:48
mashhurs added a commit to mashhurs/elasticsearch that referenced this pull request Sep 27, 2025
* Validate Logstash pipeline ID when creating.

* Checkstyle issue fix.

* Apply Exford comma.

(cherry picked from commit 9b9e665)
mashhurs added a commit to mashhurs/elasticsearch that referenced this pull request Sep 27, 2025
* Validate Logstash pipeline ID when creating.

* Checkstyle issue fix.

* Apply Exford comma.

(cherry picked from commit 9b9e665)
mashhurs added a commit to mashhurs/elasticsearch that referenced this pull request Sep 27, 2025
* Validate Logstash pipeline ID when creating.

* Checkstyle issue fix.

* Apply Exford comma.

(cherry picked from commit 9b9e665)
@mashhurs
Copy link
Contributor Author

💔 Some backports could not be created

Status Branch Result
9.1
9.0 An unhandled error occurred. Please see the logs for details
8.19
8.18

Manual backport

To create the backport manually run:

backport --pr 135378

Questions ?

Please refer to the Backport tool documentation

mashhurs added a commit to mashhurs/elasticsearch that referenced this pull request Sep 27, 2025
* Validate Logstash pipeline ID when creating.

* Checkstyle issue fix.

* Apply Exford comma.

(cherry picked from commit 9b9e665)
mashhurs added a commit to mashhurs/elasticsearch that referenced this pull request Sep 27, 2025
* Validate Logstash pipeline ID when creating.

* Checkstyle issue fix.

* Apply Exford comma.

(cherry picked from commit 9b9e665)
szybia added a commit to szybia/elasticsearch that referenced this pull request Sep 29, 2025
* upstream/main: (22 commits)
  Fix InternalCategorizationAggregationTests.testReduceRandom (elastic#135533)
  [DOCS] GeoIP processor: add clarification about using a reverse proxy endpoint (elastic#135534)
  Move `ProjectRoutingInfo` and related classes (elastic#135586)
  Refactor IndexAbstractionResolver (elastic#135587)
  Simplify returnLocalAll handling in ES|QL (elastic#135353)
  Reapply "Add an option to return early from an allocate call"  (elastic#135589)
  Mute org.elasticsearch.xpack.esql.qa.single_node.GenerativeIT test elastic#134407
  Mute org.elasticsearch.xpack.esql.heap_attack.HeapAttackIT testAggTooManyMvLongs elastic#135585
  Mute org.elasticsearch.multiproject.test.XpackWithMultipleProjectsClientYamlTestSuiteIT test {yaml=esql/60_usage/Basic ESQL usage output (telemetry) snapshot version} elastic#135579
  Mute org.elasticsearch.search.ccs.KnnVectorQueryBuilderCrossClusterSearchIT testKnnQueryWithCcsMinimizeRoundTripsFalse elastic#135573
  Mute org.elasticsearch.xpack.esql.inference.textembedding.TextEmbeddingOperatorTests testSimpleCircuitBreaking elastic#135569
  Add telemetry for `TS` command (elastic#135471)
  Mute org.elasticsearch.cluster.routing.allocation.decider.RestoreInProgressAllocationDeciderTests testCanAllocatePrimaryExistingInRestoreInProgress elastic#135566
  allocation: clarify RestoreInProgressAllocationDecider failure message (elastic#132307)
  [ES|QL] Register AggregateMetricDoubleLiteral (elastic#135054)
  Validate Logstash pipeline ID when creating. (elastic#135378)
  Migrate transport versions 8841050 through 8841041 (elastic#135555)
  Mute org.elasticsearch.search.ccs.SparseVectorQueryBuilderCrossClusterSearchIT testSparseVectorQueryWithCcsMinimizeRoundTripsFalse elastic#135559
  Mute org.elasticsearch.action.admin.cluster.stats.SearchUsageStatsTests testToXContent elastic#135558
  Testing indices query cache memory stats (elastic#135298)
  ...
mashhurs added a commit that referenced this pull request Sep 29, 2025
* Validate Logstash pipeline ID when creating.

* Checkstyle issue fix.

* Apply Exford comma.

(cherry picked from commit 9b9e665)
mashhurs added a commit that referenced this pull request Sep 29, 2025
* Validate Logstash pipeline ID when creating.

* Checkstyle issue fix.

* Apply Exford comma.

(cherry picked from commit 9b9e665)
mashhurs added a commit that referenced this pull request Sep 29, 2025
* Validate Logstash pipeline ID when creating.

* Checkstyle issue fix.

* Apply Exford comma.

(cherry picked from commit 9b9e665)
mashhurs added a commit that referenced this pull request Sep 29, 2025
* Validate Logstash pipeline ID when creating.

* Checkstyle issue fix.

* Apply Exford comma.

(cherry picked from commit 9b9e665)
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 v8.18.8 v8.19.5 v9.0.8 v9.1.5 v9.2.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Logstash Pipeline API should enforce pipeline name restrictions

3 participants