0

出力catを使用して journalctl を実行すると、例外スタック トレース全体が期待どおりに出力されます。出力jsonでjournalctlを実行すると、最初の行がスキップされます。

[root@doc-test-node01 splunk]# journalctl -f -o cat | grep undertow

13:35:31,858 ERROR [io.undertow.request] [bruker=01026300394 korrId=826gg6c45 kallId=826y7otah] (default task-62) Undertow request failed HttpServerExchange{ POST /startlan-esoknad/soknader/}: java.lang.NullPointerException
        at io.undertow.servlet.spec.ServletInputStreamImpl.readIntoBuffer(ServletInputStreamImpl.java:171)
        at io.undertow.servlet.spec.ServletInputStreamImpl.close(ServletInputStreamImpl.java:245)
        at io.undertow.servlet.spec.HttpServletRequestImpl.closeAndDrainRequest(HttpServletRequestImpl.java:602)
        at io.undertow.servlet.core.ServletBlockingHttpExchange.close(ServletBlockingHttpExchange.java:87)
        at io.undertow.server.HttpServerExchange.endExchange(HttpServerExchange.java:1444)
        at io.undertow.server.Connectors.executeRootHandler(Connectors.java:213)
        at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:759)

実行するとjournalctl -f -o json-pretty | grep undertow、journalctl は最初の行をスキップします。

[root@doc-test-node01 splunk]# journalctl -f -o json-pretty | grep undertow

        "MESSAGE" : "\u0009at io.undertow.servlet.spec.ServletInputStreamImpl.readIntoBuffer(ServletInputStreamImpl.java:171)",
        "MESSAGE" : "\u0009at io.undertow.servlet.spec.ServletInputStreamImpl.close(ServletInputStreamImpl.java:245)",
        "MESSAGE" : "\u0009at io.undertow.servlet.spec.HttpServletRequestImpl.closeAndDrainRequest(HttpServletRequestImpl.java:602)",
        "MESSAGE" : "\u0009at io.undertow.servlet.core.ServletBlockingHttpExchange.close(ServletBlockingHttpExchange.java:87)",
        "MESSAGE" : "\u0009at io.undertow.server.HttpServerExchange.endExchange(HttpServerExchange.java:1444)",
        "MESSAGE" : "\u0009at io.undertow.server.Connectors.executeRootHandler(Connectors.java:213)",
        "MESSAGE" : "\u0009at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:759)",

また、出力 json および json-sse で最初の行をスキップします。

4

1 に答える 1

0

私が見つけたのは、grepするべきではないということです。journalctl は最初の行の json を作成できず、代わりにメッセージが存在することを意味する数字を出力します。

"MESSAGE" : [ 27, 91, 48, ...
于 2015-10-29T14:07:25.683 に答える