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

freemarker.es7x.index.v4-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.Log" -->

{ "index" : { "_index" : "${index}", "_id" : "${log.getRequestId()}" } }
<@compress single_line=true>
{
  "@timestamp":"${@timestamp}"
  ,"api-id":"${log.getApiId()}"
  ,"request-id":"${log.getRequestId()}"
  ,"client-identifier":"${log.getClientIdentifier()}"
  ,"request-ended":"${log.isRequestEnded()?c}"
  <#if log.getEntrypointRequest()??>
  ,"entrypoint-request": {
  "method":"${log.getEntrypointRequest().getMethod()}",
  "uri":"${log.getEntrypointRequest().getUri()}"
    <#if log.getEntrypointRequest().getBody()??>
    ,"body":"${log.getEntrypointRequest().getBody()?j_string}"
    
    <#if log.getEntrypointRequest().getHeaders()??>
    ,"headers":{
      <#list log.getEntrypointRequest().getHeaders() as headerKey, headerValue>
        "${headerKey}": [
        <#list headerValue as value>
          <#if value??>
            "${value?j_string}"
            <#sep>,
          
        
      ]
        <#sep>,
      
    }
    
  }
  
  <#if log.getEntrypointResponse()??>
  ,"entrypoint-response": {
  "status":${log.getEntrypointResponse().getStatus()}
    <#if log.getEntrypointResponse().getBody()??>
    ,"body":"${log.getEntrypointResponse().getBody()?j_string}"
    
    <#if log.getEntrypointResponse().getHeaders()??>
    ,"headers":{
      <#list log.getEntrypointResponse().getHeaders() as headerKey, headerValue>
        "${headerKey}": [
        <#list headerValue as value>
          <#if value??>
            "${value?j_string}"
            <#sep>,
          
        
      ]
        <#sep>,
      
    }
    
  }
  
  <#if log.getEndpointRequest()??>
  ,"endpoint-request": {
  "method":"${log.getEndpointRequest().getMethod()}",
  "uri":"${log.getEndpointRequest().getUri()}"
    <#if log.getEndpointRequest().getBody()??>
    ,"body":"${log.getEndpointRequest().getBody()?j_string}"
    
    <#if log.getEndpointRequest().getHeaders()??>
    ,"headers":{
      <#list log.getEndpointRequest().getHeaders() as headerKey, headerValue>
        "${headerKey}": [
        <#list headerValue as value>
          <#if value??>
          "${value?j_string}"
            <#sep>,
          
        
      ]
        <#sep>,
      
    }
    
  }
  
  <#if log.getEndpointResponse()??>
  ,"endpoint-response": {
  "status":${log.getEndpointResponse().getStatus()}
    <#if log.getEndpointResponse().getBody()??>
    ,"body":"${log.getEndpointResponse().getBody()?j_string}"
    
    <#if log.getEndpointResponse().getHeaders()??>
    ,"headers":{
      <#list log.getEndpointResponse().getHeaders() as headerKey, headerValue>
        "${headerKey}": [
        <#list headerValue as value>
          <#if value??>
          "${value?j_string}"
            <#sep>,
          
        
      ]
        <#sep>,
      
    }
    
  }
  
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy