{"id":14008408,"url":"https://github.com/jenkinsci/logstash-plugin","last_synced_at":"2025-07-24T03:32:48.374Z","repository":{"id":6623278,"uuid":"7866898","full_name":"jenkinsci/logstash-plugin","owner":"jenkinsci","description":"Jenkins plugin to ship the console log off to Logstash","archived":false,"fork":true,"pushed_at":"2024-08-08T14:42:40.000Z","size":554,"stargazers_count":68,"open_issues_count":21,"forks_count":108,"subscribers_count":109,"default_branch":"master","last_synced_at":"2024-08-25T00:41:53.446Z","etag":null,"topics":["logging","logstash"],"latest_commit_sha":null,"homepage":"https://plugins.jenkins.io/logstash/","language":"Java","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"jesusaurus/jenkins-logstash-plugin","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jenkinsci.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-01-28T09:38:33.000Z","updated_at":"2024-08-25T00:41:53.446Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/jenkinsci/logstash-plugin","commit_stats":null,"previous_names":[],"tags_count":25,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jenkinsci%2Flogstash-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jenkinsci%2Flogstash-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jenkinsci%2Flogstash-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jenkinsci%2Flogstash-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jenkinsci","download_url":"https://codeload.github.com/jenkinsci/logstash-plugin/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227410640,"owners_count":17774779,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["logging","logstash"],"created_at":"2024-08-10T11:01:39.046Z","updated_at":"2024-11-30T19:31:06.030Z","avatar_url":"https://github.com/jenkinsci.png","language":"Java","funding_links":[],"categories":["Java"],"sub_categories":[],"readme":"Jenkins Logstash Plugin\n=======================\n\nTravis: [![Build Status](https://travis-ci.org/jenkinsci/logstash-plugin.svg?branch=master)](https://travis-ci.org/jenkinsci/logstash-plugin)\nJenkins: [![Build Status](https://ci.jenkins.io/job/Plugins/job/logstash-plugin/job/master/badge/icon)](https://ci.jenkins.io/job/Plugins/job/logstash-plugin/job/master/)\n\nThis plugin adds support for sending a job's console log to Logstash indexers such as [Elastic Search](https://www.elastic.co/products/elasticsearch), \n[Logstash](https://www.elastic.co/de/products/logstash), [RabbitMQ](https://www.rabbitmq.com), \n[Redis](https://redis.io/) or to Syslog.\n\n* use [Jira](https://issues.jenkins.io) to report issues / feature requests\n\nInstall\n=======\n\n* Search for 'Logstash' in your Jenkins plugin manager\n\nConfigure\n=========\n\nSupported methods of input/output:\n\n* ElasticSearch (REST API)\n* Logstash TCP input\n* Redis (format =\u003e 'json_event')\n* RabbitMQ (mechanism =\u003e PLAIN)\n* Syslog (format =\u003e cee/json ([RFC-5424](https://tools.ietf.org/html/rfc5424),[RFC-3164](https://tools.ietf.org/html/rfc3164)), protocol =\u003e UDP)\n\nPipeline\n=========\n\nPublisher\n---------\n\nLogstash plugin can be used as a publisher in pipeline jobs to send the\ntail of the log as a single document.\n\n**Example for publisher in pipeline**\n\n```Groovy\nnode('master') {\n    sh'''\n        echo 'Hello, world!'\n    '''\n    logstashSend failBuild: true, maxLines: 1000\n}\n```\n\nNote: Due to the way logging works in pipeline currently, the\nlogstashSend step might not transfer the lines logged directly before\nthe step is called. Adding a sleep of 1 second might help here.\n\nNote: In order to get the the result set in pipeline it must be [set\nbefore the logstashSend\nstep](https://support.cloudbees.com/hc/en-us/articles/218554077-How-to-set-current-build-result-in-Pipeline-).\n\nNote: the `logstashSend` step requires a node to run.\n\nStep with Block\n---------------\n\nIt can be used as a wrapper step to send each log line separately.\n\nOnce the result is set, it will appear in the data sent to the indexer.\n\nNote: when you combine with timestamps step, you should make the\ntimestamps the outermost block. Otherwise you get the timestamps as\npart of the log lines, basically duplicating the timestamp information.\n\n**Example for pipeline step**\n\n```Groovy\ntimestamps {\n  logstash {\n    node('somelabel') {\n      sh'''\n        echo 'Hello, World!'\n      '''\n      try {\n        // do something that fails\n        sh \"exit 1\"\n        currentBuild.result = 'SUCCESS'\n      } catch (Exception err) {\n        currentBuild.result = 'FAILURE'\n      }    \n    }\n  }\n}\n```\n\nNote: Information on which agent the steps are executed is not available\nat the moment.\n\nEnable Globally\n=======\n\nYou can enable this plugin globally in the Jenkins system configuration page, \nor with the [configuration as code](https://plugins.jenkins.io/configuration-as-code/) plugin: \n\n```yaml\nunclassified:\n  logstashConfiguration:\n    enableGlobally: true\n    enabled: true\n    logstashIndexer:\n        logstash:\n            host: \"localhost\"\n            port: 9200\n```\n\nJobProperty\n=======\n\nThis component streams individual log lines to the indexer for post-processing, \nalong with any build data that is available at the start (some information such as the build status is unavailable or incomplete).\n\nPost-Build Publisher\n=======\n\nThis component pushes the tail of the job's log to the indexer for post-processing, \nalong with all build data at the time the post-build action had started (if any post-build actions are scheduled after this plugin they will not be recorded).\n\nJSON Payload Format\n=======\n\nExample payload sent to the indexer (e.g. RabbitMQ) using the post-build action component. \n\n_Note 1: when the build wrapper is used, some information such as the build result will be missing or incomplete, \nand the \"message\" array will contain a single log line._\n\n_Note 2: `data.testResults` will only be present if a publisher records your test results in the build, \nfor example by using the [JUnit Plugin](https://plugins.jenkins.io/junit/)._\n\n\u003cdetails\u003e\n\n\u003csummary\u003eClick to expand the JSON payload\u003c/summary\u003e\n\n```json\n{\n   \"data\":{\n      \"id\":\"2014-10-13_19-51-29\",\n      \"result\":\"SUCCESS\",\n      \"projectName\":\"my_example_job\",\n      \"fullProjectName\":\"folder/my_example_job\",\n      \"displayName\":\"#1\",\n      \"fullDisplayName\":\"My Example Job #1\",\n      \"url\":\"job/my_example_job/1/\",\n      \"buildHost\":\"Jenkins\",\n      \"buildLabel\":\"\",\n      \"buildNum\":1,\n      \"buildDuration\":0,\n      \"rootProjectName\":\"my_example_job\",\n      \"rootFullProjectName\":\"folder/my_example_job\",\n\t  \"rootProjectDisplayName\":\"#1\",\n      \"rootBuildNum\":1,\n      \"buildVariables\":{\n         \"PARAM1\":\"VALUE1\",\n         \"PARAM2\":\"VALUE2\"\n      },\n      \"testResults\":{\n         \"totalCount\":45,\n         \"skipCount\":0,\n         \"failCount\":0,\n         \"failedTests\":[]\n      }\n   },\n   \"message\":[\n      \"Started by user anonymous\",\n      \"Building in workspace /var/lib/jenkins/jobs/my_example_job/workspace\",\n      \"Hello, World!\"\n   ],\n   \"source\":\"jenkins\",\n   \"source_host\":\"http://localhost:8080/jenkins/\",\n   \"@timestamp\":\"2014-10-13T19:51:29-0700\",\n   \"@version\":1\n}\n```\n\n\u003c/details\u003e\n\nChangelog\n=======\n\nSee [Changelog](./CHANGELOG.md).\n\nLicense\n=======\n\nThe Logstash Plugin is licensed under the MIT License.\n\nContributing\n============\n\n* Fork the project on [Github](https://github.com/jenkinsci/logstash-plugin)\n* Make your feature addition or bug fix, write tests, commit.\n* Send me a pull request. Bonus points for topic branches.\n\nAdding support for new indexers\n-------------------------------\n\n* Implement the extension point `jenkins.plugins.logstash.configuration.LogstashIndexer` that will take your configuration.\n* Implement `equals()` and `hashCode()`so the plugin can compare new configuration with existing configuration.\n* Create a `configure-advanced.jelly` for the UI part of your configuration.\n* Create a `help.jelly` with more details about indexer.\n* Create a new class that extends `jenkins.plugins.logstash.persistence.AbstractLogstashIndexerDao` or `jenkins.plugins.logstash.persistence.HostBasedLogstashIndexer`. This class will do the actual work of pushing the logs to the indexer.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjenkinsci%2Flogstash-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjenkinsci%2Flogstash-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjenkinsci%2Flogstash-plugin/lists"}