Timestamp Field comes as a Number type field in ES instead of a Date type
isabelnoronha61 opened this issue · 3 comments
Hi @delirius325
Timestamp field comes as a Number type in ES from Jmeter.
Ex. 1625653372892 =>Jul 7, 2021 @ 15:52:52.892
In Grafana, while configuring Datasource in Time field name : Timestamp the following error is thrown
"No date field named Timestamp found"
I was just going through the source code,
I suspect that this below line needs to be converted to date format :
addFilteredJSON("Timestamp", this.sampleResult.getTimeStamp());
It doesn't matter for ES. Use an index template. You need to create it before creating any indices.
Here the example I've used:
PUT _template/jmeter-results
{
"index_patterns": [
"*-jmeter-results-*"
],
"settings": {
"number_of_shards": "5",
"number_of_replicas": "1",
"blocks": {
"read_only_allow_delete": "false"
}
},
"mappings": {
"SampleResult": {
"properties" : {
"AllThreads" : {"type" : "long"},
"BodySize" : {"type" : "long"},
"Bytes" : {"type" : "long"},
"ConnectTime" : {"type" : "long"},
"ContentType" : {
"type" : "text",
"fields" : {"keyword" : {"type" : "keyword","ignore_above" : 256}}
},
"DataType" : {
"type" : "text",
"fields" : {"keyword" : {"type" : "keyword","ignore_above" : 256}}
},
"ElapsedTime" : {"type": "date","format": "epoch_millis"},
"ErrorCount" : {"type" : "long"},
"FailureMessage" : {
"type" : "text",
"fields" : {"keyword" : {"type" : "keyword","ignore_above" : 256}}
},
"GrpThreads" : {"type" : "long"},
"IdleTime" : {"type" : "long"},
"InjectorHostname" : {
"type" : "text",
"fields" : {"keyword" : {"type" : "keyword","ignore_above" : 256}}
},
"Latency" : {"type" : "long"},
"ResponseCode" : {
"type" : "text",
"fields" : {"keyword" : {"type" : "keyword","ignore_above" : 256}}
},
"ResponseTime" : {"type" : "long"},
"SampleCount" : {"type" : "long"},
"SampleEndTime" : {"type" : "date"},
"SampleLabel" : {
"type" : "text",
"fields" : {"keyword" : {"type" : "keyword","ignore_above" : 256}}
},
"SampleStartTime" : {"type" : "date"},
"SentBytes" : {"type" : "long"},
"Success" : {"type" : "boolean"},
"TestElement" : {
"properties" : {
"name" : {
"type" : "text",
"fields" : {"keyword" : {"type" : "keyword","ignore_above" : 256}}
}
}
},
"TestStartTime" : {"type": "date","format": "epoch_millis"},
"ThreadName" : {
"type" : "text",
"fields" : {"keyword" : {"type" : "keyword","ignore_above" : 256}}
},
"Timestamp" : {"type": "date","format": "epoch_millis"},
"URL" : {
"type" : "text",
"fields" : {"keyword" : {"type" : "keyword","ignore_above" : 256}}
}
}
}
}
}
How do you do?
How do I get the index JSON files and the Grafana panel?
I was able to create an index in ELK and connect it to Grafana, but the data is not arriving in the dashboards when I run it in Jmeter.
I believe there is a small detail missing to resolve this.
I've already done this process with the InfluxDB plugin, but I'm new to Elasticsearch.
Thanks in advance.