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

freemarker.es7x.index.health.ftl Maven / Gradle / Ivy

There is a newer version: 5.6.0
Show newest version
<#ftl output_format="JSON">
<#macro stringOrNull data="">
    <#if data != "">
    "${data}"<#else>
    null

{ "index" : { "_index" : "${index}", "_id" : "${status.getId()}" } }
<@compress single_line=true>
{
    "gateway":"${gateway}",
    "api":"${status.getApi()}",
    "endpoint":"${status.getEndpoint()}",
    "available":${status.isAvailable()?c},
    "response-time":${status.getResponseTime()},
    "success":${status.isSuccess()?c},
    "state":${status.getState()},
    "transition":${status.isTransition()?c},
    "steps": [
<#list status.getSteps() as step>
        {"name": "${step.getName()}",
        "success":${step.isSuccess()?c},
        "request": {
            "uri":"${step.getRequest().getUri()}",
            "method":"${step.getRequest().getMethod()}"
            <#if step.getRequest().getBody()??>
            ,"body":"${step.getRequest().getBody()?j_string}"
            
            <#if step.getRequest().getHeaders()??>
            ,"headers":{
                <#list step.getRequest().getHeaders() as headerKey, headerValue>
                "${headerKey}": [
                    <#list headerValue as value>
                    "${value?j_string}"
                        <#sep>,
                    
                ]
                    <#sep>,
                
            }
            
        },
        "response": {
            "status":${step.getResponse().getStatus()}
            <#if step.getResponse().getBody()??>
            ,"body":"${step.getResponse().getBody()?j_string}"
            
            <#if step.getResponse().getHeaders()??>
            ,"headers":{
                <#list step.getResponse().getHeaders() as headerKey, headerValue>
                "${headerKey}": [
                    <#list headerValue as value>
                    "${value?j_string}"
                        <#sep>,
                    
                ]
                    <#sep>,
                
            }
            
        },
        "response-time":${step.getResponseTime()},
        "message":<@stringOrNull data=step.getMessage()/>
    }<#sep>,
],
"@timestamp":"${@timestamp}"
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy