New recursive parser for rrdcgi by Arend-Jan Wijtzes <ajwytzes@wise-guys.nl>
[rrdtool.git] / doc / cdeftutorial.pod
index 3188158..101f1c9 100644 (file)
@@ -29,7 +29,7 @@ other tutorial.
 
 =head2 More reading
 
-If you have difficulties with the way I try to explain them please read
+If you have difficulties with the way I try to explain it please read
 Steve Rader's L<rpntutorial>. It may help you understand how this all works.
 
 =head1 What are CDEFs ?
@@ -725,7 +725,7 @@ If you do so, you won't be able to use these next GPRINTs:
 
 =head2 Degrees Celcius vs. Degrees Fahrenheit
 
-   rrdtool graph demo.gif --title="Demo Graph" \
+   rrdtool graph demo.png --title="Demo Graph" \
       DEF:cel=demo.rrd:exhaust:AVERAGE \
       CDEF:far=cel,32,-,0.55555,* \
       LINE2:cel#00a000:"D. Celsius" \
@@ -750,7 +750,7 @@ enough for this purpose and it saves a calculation.
 
 =head2 Changing unknown into zero
 
-   rrdtool graph demo.gif --title="Demo Graph" \
+   rrdtool graph demo.png --title="Demo Graph" \
       DEF:idat1=interface1.rrd:ds0:AVERAGE \
       DEF:idat2=interface2.rrd:ds0:AVERAGE \
       DEF:odat1=interface1.rrd:ds1:AVERAGE \
@@ -838,6 +838,31 @@ the other half of your graph. This can be done in a relatively simple
 way: what you need is the "wipeout" variable and place a negative
 sign before it:  "CDEF:wipeout2=wipeout,-1,*"
     
+=head2 Filtering data
+
+You may do some complex data filtering:
+
+  MEDIAN FILTER: filters shot noise
+
+    DEF:var=database.rrd:traffic:AVERAGE
+    CDEF:prev1=PREV(var)
+    CDEF:prev2=PREV(prev1)
+    CDEF:prev3=PREV(prev2)
+    CDEF:median=prev1,prev2,prev3,+,+,3,/
+    LINE3:median#000077:filtered
+    LINE1:prev2#007700:'raw data'
+
+
+  DERIVATE:
+
+    DEF:var=database.rrd:traffic:AVERAGE
+    CDEF:prev1=PREV(var)
+    CDEF:time=TIME
+    CDEF:prevtime=PREV(time)
+    CDEF:derivate=var,prev1,-,time,prevtime,-,/
+    LINE3:derivate#000077:derivate
+    LINE1:var#007700:'raw data'
+
 =head1 Out of ideas for now
 
 This document was created from questions asked by either myself or