Parse Jenkins' log timestamps with logstash.

* modules/openstack_project/templates/logstash/agent.conf.erb: Use the
grok, date, and mutate filters to transform Jenkins' logs from
"2013-04-08 22:46:43.659 | Started by user OpenStack Hudson" to

  @timestamp: 2013-04-08 22:46:43.659
  @message: Started by user OpenStack Hudson

Change-Id: I6aac49b4717f25838c13a2563360d03e40bb19e3
Reviewed-on: https://review.openstack.org/26446
Approved: Clark Boylan <clark.boylan@gmail.com>
Reviewed-by: Clark Boylan <clark.boylan@gmail.com>
Tested-by: Jenkins
This commit is contained in:
Clark Boylan 2013-04-08 20:18:28 -07:00 committed by Jenkins
parent d9d2af5eaf
commit 5770730f1e
1 changed files with 19 additions and 0 deletions

View File

@ -8,4 +8,23 @@ input {
}
}
# You can check grok patterns at http://grokdebug.herokuapp.com/
filter {
grok {
type => "jenkins_console"
pattern => [ "%{DATESTAMP:logdate} \| %{GREEDYDATA:logmessage}" ]
add_field => [ "received_at", "%{@timestamp}" ]
}
date {
type => "jenkins_console"
exclude_tags => "_grokparsefailure"
match => [ "logdate", "yyyy-MM-dd HH:mm:ss.SSS" ]
}
mutate {
type => "jenkins_console"
exclude_tags => "_grokparsefailure"
replace => [ "@message", "%{logmessage}" ]
}
}
<%= scope.function_template(['openstack_project/logstash/redis-output.conf.erb']) %>