# How to convert the hrs and min to sec in the log file item

**URL:** <https://discuss.elastic.co/t/how-to-convert-the-hrs-and-min-to-sec-in-the-log-file-item/172507>\
**Category:** Logstash\
**Created:** [March 15, 2019, 10:24am UTC](https://discuss.elastic.co/t/how-to-convert-the-hrs-and-min-to-sec-in-the-log-file-item/172507 "2019-03-15T10:24:49Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kharishma](https://avatars.discourse-cdn.com/v4/letter/k/b487fb/32.png) [@Kharishma](https://discuss.elastic.co/u/Kharishma)\
**Post date:** [March 15, 2019, 10:24am UTC](https://discuss.elastic.co/t/how-to-convert-the-hrs-and-min-to-sec-in-the-log-file-item/172507/1 "2019-03-15T10:24:49Z")

</div>

Hi all,

2018-12-18 08:25:56|Info|DEVAPPSVR016|11976|bgtTagger|total tagger time : 0.031 secs  
2018-12-18 09:01:06|Debug|DEVAPPSVR016|7944|bgtProtocolAdapter|[tag]  
2018-12-18 08:25:56|Stats|DEVAPPSVR016|11976|bgtTagger|canon 0.010 secs  
2018-12-18 08:25:56|Stats|DEVAPPSVR016|11976|bgtTagger|canon 0.011 secs  
2018-12-18 08:25:56|Info|DEVAPPSVR016|11976|bgtTagger|total tagger time : 0.094 secs  
2018-12-18 08:25:56|Stats|DEVAPPSVR016|7944|bgtProtocolAdapter|[tag] 16 mins 23.877 secs  
2018-12-18 08:25:56|Stats|DEVAPPSVR016|7944|bgtProtocolAdapter|[tag] 11 hrs 16 mins 23.877 secs  
2018-12-19 01:43:30|Warning|DEVAPPSVR016|9996|bgtTagger|invalid document type (ocx) specified in hint, detected (docx) document type

From the above log file details, how can I convert the "11 hrs 16 mins 23.877 secs" to the common term "secs"

Can you suggest me to modify the configuration file for this???

input {  
beats {  
port =\> 5044  
}  
}  
filter {  
grok{  
match =\> {"message" =\> "%{TIMESTAMP\_ISO8601:logtime}|%{WORD:LOGLEVEL}|%{WORD:MACHINE}|%{WORD:PROCESSID}|%{WORD:SERVICENAME}|%{WORD:PROCESS}\s+%{NUMBER:DURATION:float}\s+%{WORD:UNIT}"}  
match =\> {"message" =\> "%{TIMESTAMP\_ISO8601:logtime}|%{WORD:LOGLEVEL}|%{WORD:MACHINE}|%{WORD:PROCESSID}|%{WORD:SERVICENAME}|[%{WORD:PROCESS}]\s+%{NUMBER:DURATION:float}\s+%{WORD:UNIT}"}  
match =\> {"message" =\> "%{TIMESTAMP\_ISO8601:logtime}|%{WORD:LOGLEVEL}|%{WORD:MACHINE}|%{WORD:PROCESSID}|%{WORD:SERVICENAME}|(?%{WORD} %{WORD} %{WORD})\s+:\s+%{NUMBER:DURATION:float}\s+%{WORD:UNIT}"}  
match =\> {"message" =\> "%{TIMESTAMP\_ISO8601:logtime}|%{WORD:LOGLEVEL}|%{WORD:MACHINE}|%{WORD:PROCESSID}|%{WORD:SERVICENAME}|[%{WORD:PROCESS}]"}  
match =\> {"message" =\> "%{TIMESTAMP\_ISO8601:logtime}|%{WORD:LOGLEVEL}|%{WORD:MACHINE}|%{WORD:PROCESSID}|%{WORD:SERVICENAME}|\<%{WORD:PROCESS}\>"}  
match =\> {"message" =\> "%{TIMESTAMP\_ISO8601:logtime}|%{WORD:LOGLEVEL}|%{WORD:MACHINE}|%{WORD:PROCESSID}|%{WORD:SERVICENAME}|\<%{WORD:PROCESS}\>\s+%{NUMBER:DURATION:float}\s+%{WORD:UNIT}"}  
match =\> {"message" =\> "%{TIMESTAMP\_ISO8601:logtime}|%{WORD:LOGLEVEL}|%{WORD:MACHINE}|%{WORD:PROCESSID}|%{WORD:SERVICENAME}|%{GREEDYDATA:MSG}"}  
}  
date {  
match =\> ["logtime", "yyyy-MM-dd HH:mm:ss"]  
}

}  
output {  
elasticsearch{  
hosts =\> "localhost:9200"  
manage\_template =\> false  
index =\> "single"  
document\_type =\> "test"  
}  
stdout{codec=\>rubydebug}  
}

The above is the configuration file I have been running.....

Thanks in advance..

---

<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:** [April 12, 2019, 10:30am UTC](https://discuss.elastic.co/t/how-to-convert-the-hrs-and-min-to-sec-in-the-log-file-item/172507/2 "2019-04-12T10:30:45Z")

</div>

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