# Parsing and Calculating Navigation TIming

**URL:** <https://discuss.elastic.co/t/parsing-and-calculating-navigation-timing/74761>\
**Category:** Logstash\
**Created:** [February 11, 2017, 2:23pm UTC](https://discuss.elastic.co/t/parsing-and-calculating-navigation-timing/74761 "2017-02-11T14:23:55Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![cuenca](https://avatars.discourse-cdn.com/v4/letter/c/ecae2f/32.png) [@cuenca](https://discuss.elastic.co/u/cuenca)\
**Post date:** [February 11, 2017, 2:23pm UTC](https://discuss.elastic.co/t/parsing-and-calculating-navigation-timing/74761/1 "2017-02-11T14:23:55Z")

</div>

Hi Everyone,

I am having trouble parsing and calculating performance Navigation Timing data I have in a csv.

I was able to parse the fields but not sure how to approach the calculations (below) properly. Some points to keep in mind:

1. Data sets are grouped together by the bolded value (it is the ts of when the 21 datapoints were taken  
ACMEPage- **1486643427973** ,unloadEventEnd,1486643372422  
2.Calculations need to be done with data points within the group

I am assuming some tagging and grouping will need to be done but I don't have a clear vision on how to implement it. Any help would be greatly appreciated.

Thanks,

---------------Calculations-----------------

- Total First byte Time = responseStart - navigationStart
- Latency = responseStart – fetchStart
- DNS / Domain Lookup Time = domainLookupEnd - domainLookupStart
- Server connect Time = connectEnd - connectStart
- Server Response Time = responseStart - requestStart
- Page Load time = loadEventStart - navigationStart
- Transfer/Page Download Time = responseEnd - responseStart
- DOM Interactive Time = domInteractive - navigationStart
- DOM Content Load Time = domContentLoadedEventEnd - navigationStart
- DOM Processing to Interactive =domInteractive - domLoading
- DOM Interactive to Complete = domComplete - domInteractive
- Onload = loadEventEnd - loadEventStart

-------Data in CSV-----------  
ACMEPage-1486643427973,unloadEventEnd,1486643372422  
ACMEPage-1486643427973,responseEnd,1486643372533  
ACMEPage-1486643427973,responseStart,1486643372416  
ACMEPage-1486643427973,domInteractive,1486643373030  
ACMEPage-1486643427973,domainLookupEnd,1486643372194  
ACMEPage-1486643427973,unloadEventStart,1486643372422  
ACMEPage-1486643427973,domComplete,1486643373512  
ACMEPage-1486643427973,domContentLoadedEventStart,1486643373030  
ACMEPage-1486643427973,domainLookupStart,1486643372194  
ACMEPage-1486643427973,redirectEnd,0  
ACMEPage-1486643427973,redirectStart,0  
ACMEPage-1486643427973,connectEnd,1486643372194  
ACMEPage-1486643427973,toJSON,{}  
ACMEPage-1486643427973,connectStart,1486643372194  
ACMEPage-1486643427973,loadEventStart,1486643373512  
ACMEPage-1486643427973,navigationStart,1486643372193  
ACMEPage-1486643427973,requestStart,1486643372203  
ACMEPage-1486643427973,secureConnectionStart,0  
ACMEPage-1486643427973,fetchStart,1486643372194  
ACMEPage-1486643427973,domContentLoadedEventEnd,1486643373058  
ACMEPage-1486643427973,domLoading,1486643372433  
ACMEPage-1486643427973,loadEventEnd,1486643373514

----------Output---------------  
"path" =\> "/Users/philipp/Downloads/build2/logDataPoints\_com.concur.automation.cge.ui.admin.ADCLookup\_1486643340910.csv",  
"@timestamp" =\> 2017-02-09T12:29:57.763Z,  
"navigationTimer" =\> "connectStart",  
"@version" =\> "1",  
"host" =\> "15mbp-09796.local",  
"elapsed\_time" =\> "1486643372194",  
"pid" =\> "1486643397763",  
"page" =\> "ADCLookupDataPage",  
"message" =\> "ADCLookupDataPage-1486643397763,connectStart,1486643372194",  
"type" =\> "csv"  
}

--------------logstash.conf----------------  
input {  
file {  
type =\> "csv"  
path =\> "/Users/path/logDataPoints\_com.concur.automation.acme.ui.admin.acme\_1486643340910.csv"  
start\_position =\> beginning  
# to read from the beginning of file  
sincedb\_path =\> "/dev/null"  
}  
}

filter {  
csv {  
columns =\> ["page\_id", "navigationTimer", "elapsed\_time"]  
}

if (["elapsed\_time"] == "{}" ) {  
drop{}  
}  
else {  
grok {  
match =\> { "page\_id" =\> "%{WORD:page}-%{INT:pid}"  
}

remove\_field =\> ["page\_id"]  
}  
}

date {  
match =\> ["pid", "UNIX\_MS"]  
target =\> "@timestamp"  
}  
}

output {  
elasticsearch { hosts =\> ["localhost:9200"] }  
stdout { codec =\> rubydebug }  
}

---

<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:** [March 11, 2017, 2:24pm UTC](https://discuss.elastic.co/t/parsing-and-calculating-navigation-timing/74761/2 "2017-03-11T14:24:43Z")

</div>

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