블로그 이미지
redkite

카테고리

분류 전체보기 (291)
00.SI프로젝트 산출물 (0)
00.센터 운영 문서 (0)
01.DBMS ============.. (0)
01.오라클 (117)
01.MS-SQL (15)
01.MySQL (30)
01.PostgreSql (0)
01.DB튜닝 (28)
====================.. (0)
02.SERVER ==========.. (0)
02.서버-공통 (11)
02.서버-Linux (58)
02.서버-Unix (12)
02.서버-Windows (2)
====================.. (0)
03.APPLICATION =====.. (11)
====================.. (0)
04.ETC =============.. (0)
04.보안 (5)
====================.. (0)
05.개인자료 (1)
06.캠핑관련 (0)
07.OA관련 (1)
Total
Today
Yesterday

달력

« » 2024.4
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30

공지사항

최근에 올라온 글


2012-05-18 10:26:01,434 INFO  [com.xxxx.xxxx.server.singleton.ConnectionHASingleton] Summary (PSW Bucket: 1) 1 current(22ms), 0 shared(0ms), 0 static(0ms), 0 health(0ms) Total elapsed 26ms

I'm finding that the Severity in graylog2 is always 'Alert'. I'm using the following config file with the multiline, grok and mutate filters:

input {
  # Tail the JBoss server.log file
  file {
    type => "log4j"
    path => "/JBoss/server/all/log/server.log"
  }
}

filter {
  multiline {
    type => "log4j"
    pattern => "^\\s"
    what => "previous"
  }

  grok {
    type => "log4j"
    pattern => "%{DATESTAMP:timestamp} %{WORD:severity} %{GREEDYDATA:message}"
  }

  mutate {
    type => "log4j"
    replace => [ "@message", "%{message}" ]
  }
}

output {
  # Emit events to stdout for easy debugging of what is going through logstash
  stdout {
    debug => true
  }

  # Send Jboss log to graylog2
  gelf {
    facility => "jboss"
    host => "log01"
  }
}

Here's the logstash debug output for this log entry:

{
         "@source" => "file://stg-app01//JBoss/server/all/log/server.log",
           "@type" => "log4j",
           "@tags" => [],
         "@fields" => {
        "timestamp" => [
            [0] "2012-05-18 10:26:01,434"
        ],
         "severity" => [
            [0] "INFO"
        ],
          "message" => [
            [0] " [com.xxxx.xxxx.server.singleton.ConnectionHASingleton] Summary (PSW Bucket: 1) 1 current(22ms), 0 shared(0ms), 0 static(0ms), 0 health(0ms) Total elapsed 26ms"
        ]
    },
      "@timestamp" => "2012-05-18T10:26:01.601000Z",
    "@source_host" => "stg-app01",
    "@source_path" => "//JBoss/server/all/log/server.log",
        "@message" => " [com.xxxx.xxxx.server.singleton.ConnectionHASingleton] Summary (PSW Bucket: 1) 1 current(22ms), 0 shared(0ms), 0 static(0ms), 0 health(0ms) Total elapsed 26ms"
}

Finally, here's how graylog2 sees this entry:

From: stg-app01
Date: 2012-05-18 10:26:31 +0000
Severity: Alert
Facility: jboss
File: //JBoss/server/all/log/server.log:151
timestamp: 2012-05-18 10:26:01,434
severity: INFO
message: [com.xxxx.xxxx.server.singleton.ConnectionHASingleton] Summary (PSW Bucket: 1) 1 current(22ms), 0 shared(0ms), 0 static(0ms), 0 health(0ms) Total elapsed 26ms
Full message:
[com.xxxx.xxxx.server.singleton.ConnectionHASingleton] Summary (PSW Bucket: 1) 1 current(22ms), 0 shared(0ms), 0 static(0ms), 0 health(0ms) Total elapsed 26ms

It has two severity entries. Am I doing something wrong?

 

 

Have a look at the "level" flag in your output configuration. In your
case you'll want to change the naming in grok to something like
"jboss_severity" and then use this in your output:

gelf {
  level =>  [%{severity}, %{jboss_severity}]
  # rest of config
}

Posted by redkite
, |

최근에 달린 댓글

최근에 받은 트랙백

글 보관함