-
Notifications
You must be signed in to change notification settings - Fork 15
/
request.ftl
63 lines (63 loc) · 1.77 KB
/
request.ftl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<#ftl output_format="JSON">
<#macro stringOrNull data="">
<#if data != "">
"${data}"
<#else>
null
</#if>
</#macro>
{ "index" : { "_index" : "${index}", "_type" : "${type}", "_id" : "${metrics.getRequestId()}"<#if pipeline??>, "pipeline" : "${pipeline}"</#if>} }
<@compress single_line=true>
{
"gateway":"${gateway}"
,"@timestamp":"${@timestamp}"
,"transaction":"${metrics.getTransactionId()}"
,"method":${metrics.getHttpMethod().code()?c}
,"uri":"${metrics.getUri()}"
,"status":${metrics.getStatus()}
,"response-time":${metrics.getProxyResponseTimeMs()}
<#if apiResponseTime??>
,"api-response-time":${apiResponseTime}
</#if>
<#if proxyLatency??>
,"proxy-latency":${proxyLatency}
</#if>
<#if requestContentLength??>
,"request-content-length":${requestContentLength}
</#if>
<#if responseContentLength??>
,"response-content-length":${responseContentLength}
</#if>
<#if metrics.getApiKey()??>
,"api-key":"${metrics.getApiKey()}"
</#if>
<#if metrics.getPlan()??>
,"plan":"${metrics.getPlan()}"
</#if>
<#if metrics.getApi()??>
,"api":"${metrics.getApi()}"
</#if>
<#if metrics.getApplication()??>
,"application":"${metrics.getApplication()}"
</#if>
,"local-address":"${metrics.getLocalAddress()}"
,"remote-address":"${metrics.getRemoteAddress()}"
<#if metrics.getEndpoint()??>
,"endpoint":"${metrics.getEndpoint()}"
</#if>
<#if metrics.getTenant()??>
,"tenant":"${metrics.getTenant()}"
</#if>
<#if metrics.getMessage()??>
,"message":"${metrics.getMessage()}"
</#if>
<#if metrics.getPath()??>
,"path":"${metrics.getPath()}"
</#if>
<#if metrics.getMappedPath()??>
,"mapped-path":"${metrics.getMappedPath()}"
</#if>
<#if metrics.getHost()??>
,"host":"${metrics.getHost()}"
</#if>
}</@compress>