You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have collectd parse a log file and update a counter every 10 sec with matched regex.
On the RRD side, the database looks like this:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE rrd SYSTEM "https://oss.oetiker.ch/rrdtool/rrdtool.dtd">
<!-- Round Robin Database Dump -->
<rrd>
<version>0003</version>
<step>10</step> <!-- Seconds -->
<lastupdate>1720479757</lastupdate> <!-- 2024-07-09 01:02:37 CEST -->
<ds>
<name> value </name>
<type> COUNTER </type>
<minimal_heartbeat>20</minimal_heartbeat>
<min>NaN</min>
<max>NaN</max>
<!-- PDP Status -->
<last_ds>3973</last_ds>
<value>0.0000000000e+00</value>
<unknown_sec> 0 </unknown_sec>
</ds>
<!-- Round Robin Archives -->
<rra>
<cf>AVERAGE</cf>
<pdp_per_row>1</pdp_per_row> <!-- 10 seconds -->
<params>
<xff>1.0000000000e-01</xff>
</params>
<cdp_prep>
<ds>
<primary_value>0.0000000000e+00</primary_value>
<secondary_value>NaN</secondary_value>
<value>NaN</value>
<unknown_datapoints>0</unknown_datapoints>
</ds>
</cdp_prep>
<database>
<!-- 2024-07-08 21:42:40 CEST / 1720467760 --> <row><v>0.0000000000e+00</v></row>
<!-- 2024-07-08 21:42:50 CEST / 1720467770 --> <row><v>0.0000000000e+00</v></row>
<!-- 2024-07-08 21:43:00 CEST / 1720467780 --> <row><v>0.0000000000e+00</v></row>
<!-- 2024-07-08 21:43:10 CEST / 1720467790 --> <row><v>0.0000000000e+00</v></row>
<!-- 2024-07-08 21:43:20 CEST / 1720467800 --> <row><v>0.0000000000e+00</v></row>
<!-- 2024-07-08 21:43:30 CEST / 1720467810 --> <row><v>0.0000000000e+00</v></row>
<!-- 2024-07-08 21:43:40 CEST / 1720467820 --> <row><v>0.0000000000e+00</v></row>
<!-- 2024-07-08 21:43:50 CEST / 1720467830 --> <row><v>0.0000000000e+00</v></row>
<!-- 2024-07-08 21:44:00 CEST / 1720467840 --> <row><v>0.0000000000e+00</v></row>
<!-- 2024-07-08 21:44:10 CEST / 1720467850 --> <row><v>0.0000000000e+00</v></row>
<!-- 2024-07-08 21:44:20 CEST / 1720467860 --> <row><v>0.0000000000e+00</v></row>
<!-- 2024-07-08 21:44:30 CEST / 1720467870 --> <row><v>0.0000000000e+00</v></row>
<!-- 2024-07-08 21:44:40 CEST / 1720467880 --> <row><v>0.0000000000e+00</v></row>
<!-- 2024-07-08 21:44:50 CEST / 1720467890 --> <row><v>0.0000000000e+00</v></row>
<!-- 2024-07-08 21:45:00 CEST / 1720467900 --> <row><v>0.0000000000e+00</v></row>
<!-- 2024-07-08 21:45:10 CEST / 1720467910 --> <row><v>0.0000000000e+00</v></row>
<!-- 2024-07-08 21:45:20 CEST / 1720467920 --> <row><v>0.0000000000e+00</v></row>
<!-- 2024-07-08 21:45:30 CEST / 1720467930 --> <row><v>0.0000000000e+00</v></row>
<!-- 2024-07-08 21:45:40 CEST / 1720467940 --> <row><v>0.0000000000e+00</v></row>
<!-- 2024-07-08 21:45:50 CEST / 1720467950 --> <row><v>0.0000000000e+00</v></row>
<!-- 2024-07-08 21:46:00 CEST / 1720467960 --> <row><v>0.0000000000e+00</v></row>
<!-- 2024-07-08 21:46:10 CEST / 1720467970 --> <row><v>1.9011773847e-01</v></row>
<!-- 2024-07-08 21:46:20 CEST / 1720467980 --> <row><v>6.0988226153e-01</v></row>
(...)
When calling rrdtool graph with DEF:in=counter-post.rrd:value:AVERAGE, I get a graph of the variation per seconds. If I add --step 3600 to the call, I get an average variation per hour. But this average value does not correspond to the total/sum value I get when I parse the log and count occurences per hour.
I've read and tried VDEF with TOTAL as explained here but I get the total of matches for the whole period of rendering time. Which is not what I want either.
Is it possible to graph the sum of this value for each hour of the time range - I use --start -2d --end now?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi,
I have collectd parse a log file and update a counter every 10 sec with matched regex.
On the RRD side, the database looks like this:
When calling
rrdtool graph
withDEF:in=counter-post.rrd:value:AVERAGE
, I get a graph of the variation per seconds. If I add--step 3600
to the call, I get an average variation per hour. But this average value does not correspond to the total/sum value I get when I parse the log and count occurences per hour.I've read and tried
VDEF
withTOTAL
as explained here but I get the total of matches for the whole period of rendering time. Which is not what I want either.Is it possible to graph the sum of this value for each hour of the time range - I use
--start -2d --end now
?Beta Was this translation helpful? Give feedback.
All reactions