{
  "instant": "${json:timestamp:epoch}",
  "thread": "${json:thread:name}",
  "level": "${json:level}",
  "loggerName": "${json:logger:name}",
  "message": "${json:message}",
  "thrown": {
    "message": "${json:exception:message}",
    "name": "${json:exception:className}",
    "extendedStackTrace": "${json:exception:stackTrace}"
  },
  "contextStack": "${json:ndc}",
  "endOfBatch": "${json:endOfBatch}",
  "loggerFqcn": "${json:logger:fqcn}",
  "contextMap": "${json:mdc}",
  "threadId": "${json:thread:id}",
  "threadPriority": "${json:thread:priority}",
  "source": {
    "class": "${json:source:className}",
    "method": "${json:source:methodName}",
    "file": "${json:source:fileName}",
    "line": "${json:source:lineNumber}"
  }
}

{
  "instant": {
    "epochSecond": "${json:timestamp:epoch:divisor=1e9,integral}",
    "nanoOfSecond": 0
  },
  "thread": "${json:thread:name}",
  "level": "${json:level}",
  "loggerName": "${json:logger:name}",
  "message": "${json:message}",
  "thrown": {
    "message": "${json:exception:message}",
    "name": "${json:exception:className}",
    "extendedStackTrace": "${json:exception:stackTrace}"
  },
  "contextStack": "${json:ndc}",
  "endOfBatch": "${json:endOfBatch}",
  "loggerFqcn": "${json:logger:fqcn}",
  "contextMap": "${json:mdc}",
  "threadId": "${json:thread:id}",
  "threadPriority": "${json:thread:priority}",
  "source": {
    "class": "${json:source:className}",
    "method": "${json:source:methodName}",
    "file": "${json:source:fileName}",
    "line": "${json:source:lineNumber}"
  }
}

Fix template for Log4j 2 JSON layout.
Fix template for Log4j 2 JSON layout.
