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

Logstash plugin set @timestamp value to line output value

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Minor Minor
    • logstash-plugin
    • Logstash-plugin 1.1.0 (June 12, 2015)
      Jenkins ver. 1.583

      I noticed the timestamp and @timestamp field are always same and set to build start timestamp. Is it possible to log line generation time ? I was very confused that we have 2 timestamp dates (already fixed in 1.1.1) with same value. I expected data['timestamp'] to be build timestamp and @timestamp to be line timestamp.

      Is it by design imposible to get the current time into @timestamp ? Maybe if you do not want to implement it by yourself - reading from files generated by Timestamper could be the solution.

          [JENKINS-29830] Logstash plugin set @timestamp value to line output value

          Rusty Gerard added a comment -

          It would be fairly easy to update the @timestamp field with each message sent by the build wrapper. Modifying the post-build action to add timestamps at the start of each log line might be challenging.

          I think the best approach would be to piggyback on the Timestamper plugin; i.e. when Timestamper is installed and decorating the log, then the Logstash plugin recognizes this and adds the same to its payload. I'm not familiar with how the Timestamper plugin works, so some assistance would be appreciated.

          Rusty Gerard added a comment - It would be fairly easy to update the @timestamp field with each message sent by the build wrapper. Modifying the post-build action to add timestamps at the start of each log line might be challenging. I think the best approach would be to piggyback on the Timestamper plugin; i.e. when Timestamper is installed and decorating the log, then the Logstash plugin recognizes this and adds the same to its payload. I'm not familiar with how the Timestamper plugin works, so some assistance would be appreciated.

          Code changed in jenkins
          User: Rusty Gerard
          Path:
          src/main/java/jenkins/plugins/logstash/persistence/AbstractLogstashIndexerDao.java
          src/test/java/jenkins/plugins/logstash/persistence/AbstractLogstashIndexerDaoTest.java
          http://jenkins-ci.org/commit/logstash-plugin/2e6899bf5128ef0fd5ef950204cf4c0623915373
          Log:
          Merge pull request #13 from rwtsoftware/JENKINS-29830

          Add Timestamps

          Compare: https://github.com/jenkinsci/logstash-plugin/compare/7b20502a6d5e...2e6899bf5128

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Rusty Gerard Path: src/main/java/jenkins/plugins/logstash/persistence/AbstractLogstashIndexerDao.java src/test/java/jenkins/plugins/logstash/persistence/AbstractLogstashIndexerDaoTest.java http://jenkins-ci.org/commit/logstash-plugin/2e6899bf5128ef0fd5ef950204cf4c0623915373 Log: Merge pull request #13 from rwtsoftware/ JENKINS-29830 Add Timestamps Compare: https://github.com/jenkinsci/logstash-plugin/compare/7b20502a6d5e...2e6899bf5128

          Rusty Gerard added a comment -

          This is available in the build wrapper starting with version 1.2.0. Currently it is not implemented in the post-build action.

          Rusty Gerard added a comment - This is available in the build wrapper starting with version 1.2.0. Currently it is not implemented in the post-build action.

            Unassigned Unassigned
            alkuzad Dawid Gosławski
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: