Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-52048

Add arbitrary tags to wrapper logs

XMLWordPrintable

    • Icon: New Feature New Feature
    • Resolution: Unresolved
    • Icon: Minor Minor
    • logstash-plugin
    • None

      While it's nice to be able to use the Logstash plugin as both a post-build shipper or a step wrapper, there's very little on which to filter in Kibana to distinguish documents shipped by different steps. It would be really simple yet helpful for the wrapper to accept an argument to tag logs shipped by that step with a specific value.

      For example:

      logstash('my tag name') {
        // do stuff here
      }
      

       

      This would ship a document with a custom field (let's call it 'myTag' for simplicity) which would be populated by the string argument passed into the pipeline step. In Kibana, I would then filter for logs from just that step with

      data.myTag.keyword:"my tag name"

       

      Multiple tags could also be added by passing more than one string argument:

      logstash('first tag', myStringMethod(), "Tag number ${env.BUILD_NUMBER}") {
        // this step has multiple searchable tags
        // data.myTag.keyword:("first tag" OR "result of string method" OR "Tag number 3")
      }
      

       

       

            jbochenski Jakub Bochenski
            jlahr John Lahr
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: