# Logstash Jmeter Date calculation Epoch to Humandate

**URL:** <https://discuss.elastic.co/t/logstash-jmeter-date-calculation-epoch-to-humandate/105407>\
**Category:** Logstash\
**Created:** [October 26, 2017, 10:57am UTC](https://discuss.elastic.co/t/logstash-jmeter-date-calculation-epoch-to-humandate/105407 "2017-10-26T10:57:34Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sri535](https://avatars.discourse-cdn.com/v4/letter/s/779978/32.png) [@sri535](https://discuss.elastic.co/u/sri535)\
**Post date:** [October 26, 2017, 10:57am UTC](https://discuss.elastic.co/t/logstash-jmeter-date-calculation-epoch-to-humandate/105407/1 "2017-10-26T10:57:35Z")

</div>

## HI by using elk preparing Dashboard for Jmeter Lt results.Jmeter writes result to file by using Flexible file writer . i configured That textfile /csv to Logstash but the problem is it had startTime and EndTime variables returning in epoch values so iam not able to convert those into human date and make difference b/w them. below is the sample of result file.

TargetApplication,StartTime,Transaction,AvgResponseTime,ResponseCode,SentBytes,Throughput,Latency,Status  
MyAPP,1509004004580,Launch,4024,200,88,5810,3462,1  
MyAPP,1509004011380,Launch,155,200,88,5810,134,1

* * *

and below is the logstash conf file:

input {  
file {  
path =\> ["D:/LoadTests/LT\*.csv"]  
start\_position =\> "beginning"  
}  
}

filter {

```
grok {

```

match =\> ["message" ,"%{DATA:TargetApplication},%{INT:StartTime},%{DATA:Transaction},%{NUMBER:AvgResponseTime},%{DATA:ResponseCode},%{NUMBER:SentBytes},%{NUMBER:Throughput},%{NUMBER:Latency},%{WORD:Status}"]

}

date {

match =\> ["StartTime","UNIX"]

target =\> "StartTime"

}

if "1" in [Status] {

mutate {  
replace =\> {"Status" =\> "Pass" }  
}  
}  
if "0" in [Status] {

mutate {  
replace =\> { "Status" =\> "Fail" }  
}  
}

mutate {

convert =\>{  
"AvgResponseTime" =\> "integer"  
"SentBytes" =\> "integer"  
"Throughput" =\> "integer"  
"Latency" =\> "integer"

}

}

## } output { file { path =\> "D:\MW\OutPutLogs\OLTDC12.txt" } elasticsearch { hosts =\> "localhost:9200" index =\> "dappslt-%{+YYYY.MM.dd}" template\_name =\> "dappslt\*" template =\> "D:\logstash\templates\template\_dappslt.json" template\_overwrite =\> true manage\_template =\> true } }

i used date filter to convert to humandate.

date {

match =\> ["StartTime","UNIX"]

target =\> "StartTime"

}

1509004004580 this is the startTime epoch value (Epoch time when the request was started)  
there are no grok failures but this time not converting to human date if it works i had to make difference of start and end time if any one had worked with please help on thi thanks inadvance

using 5.6 ELK

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [November 23, 2017, 10:57am UTC](https://discuss.elastic.co/t/logstash-jmeter-date-calculation-epoch-to-humandate/105407/2 "2017-11-23T10:57:36Z")

</div>

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