Hi,
I have created a chart using Timelion on canvas.
kibana
|filters
| timelion
query=".es(index='traces-apm*,apm-*,logs-apm*,apm-*,metrics-apm*,apm-*',metric=avg:transaction.duration.us, timefield=@timestamp,q=' _exists_:transaction.duration.us', split=agent.name:10).label(\"$1\", \"^.*name:(\\S+).*\")" interval="1w"
| pointseries x="@timestamp" y="value" color="label"
| plot defaultStyle={seriesStyle fill="1" lines="2"}
palette={palette "#44697D" "#5E2D61" "#739ABC" "#72CE98" "#4B92DB" "#BF2296" "#949D9E" "#5E6A71" "#AF94A3" gradient=false} legend="nw"
font={font family={ theme "font.family" default="'Open Sans', Helvetica, Arial, sans-serif" } size=12 align="left" color="#000099" weight=600 underline=false italic=false}
| render containerStyle={containerStyle backgroundColor="#FFFFFF" border="1px solid #BBBBBB" borderRadius="4px" padding="10px" opacity="1"}
I have also created a filter for applying on chart.
filters
| timelion
query=".es(index='traces-apm*,apm-*,logs-apm*,apm-*,metrics-apm*,apm-*',metric=avg:transaction.duration.us, timefield=@timestamp,q=' _exists_:transaction.duration.us', split=agent.name:10).label(\"$1\", \"^.*name:(\\S+).*\")" interval="1w"
| mapColumn "label" fn={getCell "label"}
| dropdownControl valueColumn="label" filterColumn="label"
| render
But when I select any filter it doesn't apply on chart.
Sample document from data
{
"_index": "xyz",
"_id": "xyz",
"_version": 1,
"_score": 0,
"_source": {
"container": {
"id": "xyz"
},
"agent": {
"name": "java",
"ephemeral_id": "xyz",
"version": "1.31.0"
},
"process": {
"pid": 1,
"title": "xyz"
},
"data_stream.namespace": "default",
"source": {
"nat": {
"ip": "::1"
},
"ip": "xyz"
},
"data_stream.type": "traces",
"processor": {
"name": "transaction",
"event": "transaction"
},
"url": {
"path": "xyz",
"scheme": "http",
"port": xyz,
"domain": "xyz",
"full": "xyz"
},
"cloud": {
"instance": {
"name": "xyz",
"id": "xyz"
},
"provider": "azure",
"machine": {
"type": "Standard_D8s_v3"
},
"project": {
"name": "xyz"
},
"region": "eastus",
"account": {
"id": "xyz"
}
},
"observer": {
"hostname": "xyz",
"name": "xyz",
"id": "xyz",
"type": "xyz",
"ephemeral_id": "xyz",
"version": "8.5.0"
},
"trace": {
"id": "xyz"
},
"@timestamp": "2022-11-30T05:41:52.192Z",
"ecs": {
"version": "1.12.0"
},
"service": {
"node": {
"name": "xyz"
},
"environment": "Production",
"framework": {
"name": "xyz",
"version": "xyz"
},
"name": "xyz",
"runtime": {
"name": "Java",
"version": "16.0.1"
},
"language": {
"name": "Java",
"version": "16.0.1"
},
"version": "1.0"
},
"data_stream.dataset": "apm",
"host": {
"hostname": "xyz",
"os": {
"platform": "Linux"
},
"ip": [
"xyz"
],
"name": "xyz",
"architecture": "xyz"
},
"client": {
"geo": {
"continent_name": "xyz",
"region_iso_code": "xyz",
"city_name": "xyz",
"country_iso_code": "xyz",
"country_name": "xyz",
"region_name": "xyz",
"location": {
"lon": -xyz,
"lat": xyz
}
},
"ip": "xyz"
},
"http": {
"request": {
"headers": {
"Connection": [
"close"
],
"User-Agent": [
"xyz"
],
"X-Forwarded-Proto": [
"http"
],
"X-Forwarded-For": [
"xyz"
],
"Host": [
"xyz"
],
"X-Real-Ip": [
"xyz"
]
},
"method": "GET"
},
"response": {
"headers": {
"Cache-Control": [
"no-cache, no-store, max-age=0, must-revalidate"
],
"X-Content-Type-Options": [
"nosniff"
],
"X-Xss-Protection": [
"1; mode=block"
],
"Connection": [
"close"
],
"Vary": [
"Origin",
"Access-Control-Request-Method",
"Access-Control-Request-Headers",
"Origin",
"Access-Control-Request-Method",
"Access-Control-Request-Headers",
"Origin",
"Access-Control-Request-Method",
"Access-Control-Request-Headers"
],
"Pragma": [
"no-cache"
],
"Expires": [
"0"
],
"Content-Length": [
"5"
],
"Date": [
"Wed, 30 Nov 2022 05:41:52 GMT"
],
"Content-Type": [
"text/plain;charset=UTF-8"
]
},
"status_code": 200,
"finished": true,
"headers_sent": true
},
"version": "1.1"
},
"event": {
"agent_id_status": "missing",
"ingested": "2022-11-30T05:42:02Z",
"outcome": "success"
},
"transaction": {
"result": "HTTP 2xx",
"duration": {
"us": 1245
},
"name": "xyz",
"id": "xyz",
"span_count": {
"dropped": 0,
"started": 0
},
"type": "request",
"sampled": true
},
"user_agent": {
"original": "xyz",
"os": {
"name": "Linux"
},
"name": "Other",
"device": {
"name": "Other"
}
},
"timestamp": {
"us": xyz
}
},
"fields": {
"transaction.name.text": [
"LoginController#getVersion"
],
"http.response.headers.Connection": [
"close"
],
"user_agent.original.text": [
"xyz"
],
"client.geo.country_iso_code": [
"US"
],
"host.hostname": [
"xyz"
],
"service.language.name": [
"Java"
],
"transaction.result": [
"HTTP 2xx"
],
"container.id": [
"xyz"
],
"transaction.id": [
"xyz"
],
"source.ip": [
"xyz"
],
"http.response.finished": [
true
],
"agent.name": [
"java"
],
"event.agent_id_status": [
"missing"
],
"http.response.status_code": [
200
],
"http.version": [
"1.1"
],
"event.outcome": [
"success"
],
"user_agent.original": [
"xyz"
],
"cloud.region": [
"xyz"
],
"http.response.headers.Cache-Control": [
"xyz"
],
"transaction.duration.us": [
xyz
],
"service.runtime.version": [
"xyz"
],
"host.architecture": [
"xyz"
],
"cloud.machine.type": [
"xyz"
],
"cloud.provider": [
"xyz"
],
"url.path": [
"xyz"
],
"observer.version": [
"xyz"
],
"transaction.name": [
"LoginController#getVersion"
],
"http.response.headers.X-Xss-Protection": [
"1; mode=block"
],
"http.response.headers.Vary": [
"Origin",
"Access-Control-Request-Method",
"Access-Control-Request-Headers",
"Origin",
"Access-Control-Request-Method",
"Access-Control-Request-Headers",
"Origin",
"Access-Control-Request-Method",
"Access-Control-Request-Headers"
],
"observer.name": [
"xyz"
],
"service.node.name": [
"xyz"
],
"url.scheme": [
"http"
],
"cloud.project.name": [
"xyz"
],
"source.nat.ip": [
"::1"
],
"transaction.sampled": [
true
],
"user_agent.os.name": [
"Linux"
],
"cloud.instance.id": [
"xyz"
],
"host.ip": [
"xyz"
],
"client.geo.region_name": [
"xyz"
],
"transaction.span_count.dropped": [
0
],
"http.response.headers.Content-Length": [
"5"
],
"http.request.headers.User-Agent": [
"xyz"
],
"service.environment": [
"Production"
],
"observer.hostname": [
"xyz"
],
"url.full.text": [
"xyz"
],
"http.request.headers.Connection": [
"close"
],
"transaction.span_count.started": [
0
],
"event.ingested": [
"2022-11-30T05:42:02.000Z"
],
"@timestamp": [
"2022-11-30T05:41:52.192Z"
],
"service.version": [
"1.0"
],
"host.os.platform": [
"Linux"
],
"cloud.account.id": [
"xyz"
],
"data_stream.dataset": [
"apm"
],
"service.language.version": [
"16.0.1"
],
"http.response.headers.X-Content-Type-Options": [
"xyz"
],
"url.domain": [
"xyz"
],
"agent.ephemeral_id": [
"xyz"
],
"user_agent.device.name": [
"Other"
],
"cloud.instance.name": [
"xyz"
],
"http.response.headers.Pragma": [
"no-cache"
],
"process.pid": [
1
],
"process.title.text": [
"xyz"
],
"http.request.method": [
"GET"
],
"processor.event": [
"transaction"
],
"host.name": [
"xyz"
],
"client.geo.country_name": [
"United States"
],
"processor.name": [
"transaction"
],
"user_agent.name": [
"Other"
],
"client.ip": [
"xyz"
],
"http.request.headers.Host": [
"xyz"
],
"data_stream.type": [
"traces"
],
"http.request.headers.X-Real-Ip": [
"xyz"
],
"http.request.headers.X-Forwarded-For": [
"xyz"
],
"observer.id": [
"xyz"
],
"timestamp.us": [
xyz
],
"ecs.version": [
"1.12.0"
],
"observer.type": [
"xyz"
],
"http.response.headers.Expires": [
"0"
],
"http.response.headers_sent": [
true
],
"agent.version": [
"1.31.0"
],
"process.title": [
"xyz"
],
"client.geo.continent_name": [
"xyz"
],
"service.framework.version": [
"xyz"
],
"http.response.headers.Date": [
"xyz"
],
"http.request.headers.X-Forwarded-Proto": [
"http"
],
"user_agent.os.name.text": [
"Linux"
],
"trace.id": [
"xyz"
],
"client.geo.location": [
{
"coordinates": [
xyz,
xyz
],
"type": "Point"
}
],
"url.port": [
xyz
],
"url.full": [
"xyz"
],
"client.geo.city_name": [
"xyz"
],
"client.geo.region_iso_code": [
"xyz"
],
"service.name": [
"xyz"
],
"service.framework.name": [
"xyz"
],
"data_stream.namespace": [
"default"
],
"service.runtime.name": [
"Java"
],
"transaction.type": [
"request"
],
"observer.ephemeral_id": [
"xyz"
],
"http.response.headers.Content-Type": [
"xyz"
]
}
}