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

Send individual log lines to Logstash

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Minor
    • Resolution: Not A Defect
    • Component/s: logstash-plugin
    • Labels:
      None
    • Environment:
      Java8, jenkins.version = 2.7.4, plugin version = 2.15
    • Similar Issues:

      Description

      Hi, 

      I printed out the data I receive in the push function and I can see that even when the "Send console log to Logstash" is not checked I get the console lines line by line, in addition, to get them all at once. 

      I first checked the box and then when I saw that I unchecked the box, so maybe the uncheck is not changing back the configurations? 

      Is it the expected behavior?

      Thanks

        Attachments

          Activity

          Hide
          jbochenski Jakub Bochenski added a comment -

          Line by line and whole log at once are done via separate extension points. One is a job property and one is a post build step, you can enable/disable them independently.

          Show
          jbochenski Jakub Bochenski added a comment - Line by line and whole log at once are done via separate extension points. One is a job property and one is a post build step, you can enable/disable them independently.
          Hide
          mwinter69 Markus Winter added a comment -

          A third possibility is the enable globally when you have freestyle builds (not a pipeline job).

          Maybe we should add some logic to avoid sending data multiple times, e.g. when enabled globally or via JobProperty then adding the post build step will have no effect.

          Enable Globally and JobProperty already work via the ConsoleLogFilter so they will not send duplicate data.

          Show
          mwinter69 Markus Winter added a comment - A third possibility is the enable globally when you have freestyle builds (not a pipeline job). Maybe we should add some logic to avoid sending data multiple times, e.g. when enabled globally or via JobProperty then adding the post build step will have no effect. Enable Globally and JobProperty already work via the ConsoleLogFilter so they will not send duplicate data.
          Hide
          jbochenski Jakub Bochenski added a comment -

          > Maybe we should add some logic to avoid sending data multiple times, e.g. when enabled globally or via JobProperty then adding the post build step will have no effect.

          Good idea, though I'd start with just emitting a warning at first (make the build unstable?).

          Show
          jbochenski Jakub Bochenski added a comment - > Maybe we should add some logic to avoid sending data multiple times, e.g. when enabled globally or via JobProperty then adding the post build step will have no effect. Good idea, though I'd start with just emitting a warning at first (make the build unstable?).
          Hide
          idohalevi Ido Halevi added a comment -

          But when I check the box `Send console log to Logstash` I see the plugin tries to send line by line and in addition, it tries to send them in a bulk at the end when the build is done. In this case, we send the logs twice, 'real time' and post-build bulk. One more thing that can occur is if we have a really big console log, we will get `
          FATAL: Java heap space
          java.lang.OutOfMemoryError: Java heap space

          I tried to solve it by sending the logs line by line but like I said above at the end of the build it will try to send the logs in bulk and will fail again with the exception above.

          Show
          idohalevi Ido Halevi added a comment - But when I check the box `Send console log to Logstash` I see the plugin tries to send line by line and in addition, it tries to send them in a bulk at the end when the build is done. In this case, we send the logs twice, 'real time' and post-build bulk. One more thing that can occur is if we have a really big console log, we will get ` FATAL: Java heap space java.lang.OutOfMemoryError: Java heap space `  I tried to solve it by sending the logs line by line but like I said above at the end of the build it will try to send the logs in bulk and will fail again with the exception above.
          Hide
          mwinter69 Markus Winter added a comment -

          When it tries to send line by line you have either enabled globally or you set the JobProperty.
          It sends in bulk at the end when you added the post build step.
          So maybe you should remove the post build step.

          Show
          mwinter69 Markus Winter added a comment - When it tries to send line by line you have either enabled globally or you set the JobProperty. It sends in bulk at the end when you added the post build step. So maybe you should remove the post build step.
          Hide
          idohalevi Ido Halevi added a comment -

          Thank you, I was sure if the box is checked it cancel the bulk.

          Show
          idohalevi Ido Halevi added a comment - Thank you, I was sure if the box is checked it cancel the bulk.

            People

            Assignee:
            jbochenski Jakub Bochenski
            Reporter:
            idohalevi Ido Halevi
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: