Last active
August 29, 2015 14:19
-
-
Save hourback/56e93786df14a17b14da to your computer and use it in GitHub Desktop.
Lua decoder for Heka, for reading in WebSphere SystemOut.log files with unrecognized time stamp format
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[4/23/15 4:49:49:371 CDT] 00003a01 CoordinatorCo E HMGR0140E: An event indicating that the core group membership is inconsistent was received. Recovery failed. The exception is com.ibm.ws.hamanager.runtime.config.ServerIndexNodeException: serverindex for node janmsdlxwas04 does not contain server celig1_janmsdlxwas04_cnataraj | |
at com.ibm.ws.hamanager.runtime.config.CoreGroupProcesses$ServerIndexParser.getServerIndexForServer(CoreGroupProcesses.java:376) | |
at com.ibm.ws.hamanager.runtime.config.CoreGroupProcesses.<init>(CoreGroupProcesses.java:135) | |
at com.ibm.ws.hamanager.runtime.config.CoreGroupConfig.<init>(CoreGroupConfig.java:113) | |
at com.ibm.ws.hamanager.runtime.config.StateBlobBuilder.buildBlob(StateBlobBuilder.java:104) | |
at com.ibm.ws.hamanager.runtime.CoordinatorComponentImpl$InconsistentDefinedSetHandler.run(CoordinatorComponentImpl.java:1127) | |
at java.lang.Thread.run(Thread.java:738) | |
. | |
[4/23/15 4:50:30:005 CDT] 0000002e DiscoveryRcv I DCSV1031I: DCS Stack DefaultCoreGroup at Member janmsdlxwas04Network\janmsdlxwas04\rma_ABD: Received a connection from an undefined member janmsdlxwas04Network\janmsdlxwas04\vvelig_janmsdlxwas04_bvatnala. Source address is /10.221.90.109. | |
[4/23/15 4:50:30:039 CDT] 00003a02 CoreGroupProc W HMGR0060W: An error was encountered while obtaining the host and port information for server celig1_janmsdlxwas04_cnataraj on node janmsdlxwas04. | |
[4/23/15 4:50:30:039 CDT] 00003a02 CoordinatorCo E HMGR0140E: An event indicating that the core group membership is inconsistent was received. Recovery failed. The exception is com.ibm.ws.hamanager.runtime.config.ServerIndexNodeException: serverindex for node janmsdlxwas04 does not contain server celig1_janmsdlxwas04_cnataraj | |
at com.ibm.ws.hamanager.runtime.config.CoreGroupProcesses$ServerIndexParser.getServerIndexForServer(CoreGroupProcesses.java:376) | |
at com.ibm.ws.hamanager.runtime.config.CoreGroupProcesses.<init>(CoreGroupProcesses.java:135) | |
at com.ibm.ws.hamanager.runtime.config.CoreGroupConfig.<init>(CoreGroupConfig.java:113) | |
at com.ibm.ws.hamanager.runtime.config.StateBlobBuilder.buildBlob(StateBlobBuilder.java:104) | |
at com.ibm.ws.hamanager.runtime.CoordinatorComponentImpl$InconsistentDefinedSetHandler.run(CoordinatorComponentImpl.java:1127) | |
at java.lang.Thread.run(Thread.java:738) | |
. | |
[4/23/15 4:50:54:993 CDT] 0000002e DiscoveryRcv I DCSV1031I: DCS Stack DefaultCoreGroup at Member janmsdlxwas04Network\janmsdlxwas04\rma_ABD: Received a connection from an undefined member janmsdlxwas04Network\janmsdlxwas04\selg_janmsdlxwas04_smadamsetti. Source address is /10.221.90.109. | |
[4/23/15 4:50:55:066 CDT] 00003a03 CoreGroupProc W HMGR0060W: An error was encountered while obtaining the host and port information for server celig1_janmsdlxwas04_cnataraj on node janmsdlxwas04. | |
[4/23/15 4:50:55:068 CDT] 00003a03 CoordinatorCo E HMGR0140E: An event indicating that the core group membership is inconsistent was received. Recovery failed. The exception is com.ibm.ws.hamanager.runtime.config.ServerIndexNodeException: serverindex for node janmsdlxwas04 does not contain server celig1_janmsdlxwas04_cnataraj | |
at com.ibm.ws.hamanager.runtime.config.CoreGroupProcesses$ServerIndexParser.getServerIndexForServer(CoreGroupProcesses.java:376) | |
at com.ibm.ws.hamanager.runtime.config.CoreGroupProcesses.<init>(CoreGroupProcesses.java:135) | |
at com.ibm.ws.hamanager.runtime.config.CoreGroupConfig.<init>(CoreGroupConfig.java:113) | |
at com.ibm.ws.hamanager.runtime.config.StateBlobBuilder.buildBlob(StateBlobBuilder.java:104) | |
at com.ibm.ws.hamanager.runtime.CoordinatorComponentImpl$InconsistentDefinedSetHandler.run(CoordinatorComponentImpl.java:1127) | |
at java.lang.Thread.run(Thread.java:738) | |
. | |
[4/23/15 4:51:08:786 CDT] 0000002e DiscoveryRcv I DCSV1031I: DCS Stack DefaultCoreGroup at Member janmsdlxwas04Network\janmsdlxwas04\rma_ABD: Received a connection from an undefined member janmsdlxwas04Network\janmsdlxwas04\nElig_janmsdlxwas04_pkumar. Source address is /10.221.90.109. | |
[4/23/15 4:51:08:820 CDT] 00003a04 CoreGroupProc W HMGR0060W: An error was encountered while obtaining the host and port information for server celig1_janmsdlxwas04_cnataraj on node janmsdlxwas04. | |
[4/23/15 4:51:08:821 CDT] 00003a04 CoordinatorCo E HMGR0140E: An event indicating that the core group membership is inconsistent was received. Recovery failed. The exception is com.ibm.ws.hamanager.runtime.config.ServerIndexNodeException: serverindex for node janmsdlxwas04 does not contain server celig1_janmsdlxwas04_cnataraj | |
at com.ibm.ws.hamanager.runtime.config.CoreGroupProcesses$ServerIndexParser.getServerIndexForServer(CoreGroupProcesses.java:376) | |
at com.ibm.ws.hamanager.runtime.config.CoreGroupProcesses.<init>(CoreGroupProcesses.java:135) | |
at com.ibm.ws.hamanager.runtime.config.CoreGroupConfig.<init>(CoreGroupConfig.java:113) | |
at com.ibm.ws.hamanager.runtime.config.StateBlobBuilder.buildBlob(StateBlobBuilder.java:104) | |
at com.ibm.ws.hamanager.runtime.CoordinatorComponentImpl$InconsistentDefinedSetHandler.run(CoordinatorComponentImpl.java:1127) | |
at java.lang.Thread.run(Thread.java:738) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local msg_type = read_config("type") | |
local dt = require "date_time" | |
local l = require "lpeg" | |
l.locale(l) | |
local timestamp = "[" * l.Cg(l.Ct(l.Cg(l.digit^1, "month") * "/" * l.Cg(l.digit^1, "day") * "/" * l.Cg(l.Cs(l.digit^2) / "20%1", "year") * " " * l.Cg(l.digit^1, "hour") * ":" * l.Cg(l.digit^1, "min") * ":" * l.Cg(l.digit^2, "sec") * ":" * l.Cg(l.digit^3, "sec_frac") * " " * l.Cg(dt.timezone, "timezone")) / dt.time_to_ns, "Timestamp") * "]" | |
local eventEnd = l.P".\n" | |
local sp = l.P" " | |
local bigMessage = l.Cg((l.P(1) - eventEnd)^0, "bigMessage") | |
local msg = timestamp * sp * bigMessage | |
grammar = l.Ct(msg) | |
local msg = { | |
Timestamp = nil, | |
Type = msg_type, | |
Payload = nil, | |
} | |
function process_message () | |
local log = read_message("Payload") | |
local fields = grammar:match(log) | |
if not fields then return -1 end | |
msg.Timestamp = fields.Timestamp | |
msg.Payload = fields.bigMessage | |
inject_message(msg) | |
return 0 | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thank you, @trink! :-)
Looking over them now.