Changes between Version 3 and Version 4 of rrdtool


Ignore:
Timestamp:
02/01/22 02:07:57 (3 years ago)
Author:
krit
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • rrdtool

    v3 v4  
    1313Wed 18 Aug 2021 10:00:00 PM +07
    1414}}}
     15
     16Convert date from epoch time to human readable format
     17{{{
     18#!sh
     19OMD[monitor@501264b41d2d]:~/var/log$ awk -F"[][]" '{cmd="date -d@" $2;cmd |getline $2; close(cmd)}1' naemon.log
     20}}}
     21Here we set a shell command date -d@$2 to a variable called cmd. Then with cmd |getline $2 the awk reads a line and pass second field value to the cmd we open it, then we need close the command we opened via pipe, so we used close(cmd)