Creating latency graph using timelion or line graph

Hi,

I have some documents in elasticsearch, below is the sample document.

{
"_index": "mulesoft-log-mon-2019.03.05",
"_type": "doc",
"_id": "yCPzTWkBSDlUxQpoJfQf",
"_score": 1,
"_source": {
"policyViolation": null,
"transactionId": null,
"applicationName": "CBS Monitoring App",
"userAgent": "runscope-radar/2.0",
"hostId": "mule.qa.2",
"requestBytes": 65,
"apiVersion": "1.0.0",
"eventId": "2-bce585b0-2382-11e9-8b05-0242ac120002",
"orgId": "eeb3ccb6-a2f4-4c7b-9459-7202183bce03",
"apiVersionId": 15552430,
"clientId": "fadce792e5124b7eb7cd8bef2026717f",
"repliedTs": "2019-01-29T00:00:06.121-05:00",
"instanceName": "1.0.0:15552430",
"host": "L-156106076",
"receivedTs": "2019-01-29T00:00:03.339-05:00",
"@version": "1",
"requestDisposition": "PROCESSED",
"responseBytes": 2661,
"apiId": 210966762,
"path": "/hma/v1.0/mc/offers/recommended?t=e6ceaa7b-f6cb-4df9-90ae-9cf6f6428bf0&n=1000&so=asc&i=0&sb=OT",
"@timestamp": "2019-03-05T13:02:48.780Z",
"type": "json",
"verb": "POST",
"statusCode": 200,
"clientIp": "10.129.40.136",
"apiName": "hannafordmobile-xapi"
}
}

My requirement is I need to plot a graph using (receivedTs) and (repliedTs), where both are date fields.

It is more like when was request received and replied for it (which is in seconds/millisecs).

Two different lines.

Something like below:


Can any one help me out with it.

Hey,

what is on your Y axis ?
in timelion you can plot two lines just by separating definitions with comma:
.es(timefield=receivedTs), .es(timefied=repliedTs)

yes, something like this should work:

.es(*).divide(.es(*)) (one serie devided with the other)
.es(...), .es(....), .es(...).divide(.es(...)) to do 3

Hi @ppisljar,

Sorry it was my bad, I have not observed the query. There was "l" missing in timefield.

with little bit of search was able to find subtraction (.es(timefield=receivedTs).subtract(.es(timefield=repliedTs)).label(timeTaken)).

I had one question:

How can I get only this graph only for "apiName": "hannafordmobile-xapi".

Current query I am using is as below.
.es(timefield=receivedTs).label(receivedTs), .es(timefield=repliedTs).label(repliedTs), .es(timefield=receivedTs).subtract(.es(timefield=repliedTs)).

Thanks & Regards,
Dheeraj B

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.