All Downloads are FREE. Search and download functionalities are using the official Maven repository.

freemarker.es8x.index.v4-message-log.ftl Maven / Gradle / Ivy

There is a newer version: 5.6.0
Show newest version
<#-- @ftlvariable name="index" type="java.lang.String" -->
<#-- @ftlvariable name="@timestamp" type="java.lang.String" -->
<#-- @ftlvariable name="log" type="io.gravitee.reporter.api.v4.log.MessageLog" -->

{ "index" : { "_index" : "${index}", "_id" : "${log.getCorrelationId()}-${log.getConnectorType().getLabel()}" } }
<@compress single_line=true>
{
  "@timestamp":"${@timestamp}"
  ,"api-id":"${log.getApiId()}"
  ,"request-id":"${log.getRequestId()}"
  ,"client-identifier":"${log.getClientIdentifier()}"
  ,"correlation-id":"${log.getCorrelationId()}"
  <#if log.getParentCorrelationId()??>
  ,"parent-correlation-id":"${log.getParentCorrelationId()}"
  
  ,"operation":"${log.getOperation().getLabel()}"
  ,"connector-type":"${log.getConnectorType().getLabel()}"
  ,"connector-id":"${log.getConnectorId()}"
  ,"message": {
    "id":"${(log.getMessage().getId())!}"
    <#if log.getMessage().isError()>
    ,"error":"${log.getMessage().isError()?c}"
    
    <#if log.getMessage().getPayload()??>
    ,"payload":"${log.getMessage().getPayload()?j_string}"
    
    <#if log.getMessage().getHeaders()??>
    ,"headers":{
      <#list log.getMessage().getHeaders() as headerKey, headerValue>
        "${headerKey}": [
        <#list headerValue as value>
          <#if value??>
            "${value?j_string}"
            <#sep>,
          
        
      ]
        <#sep>,
      
    }
    
    <#if log.getMessage().getMetadata()??>
    ,"metadata":{
    <#list log.getMessage().getMetadata() as metadataKey, metadataValue>
      "${metadataKey}": "${metadataValue}"
      <#sep>,
    
    }
    
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy