log logview lines only
authorChristian Weiske <cweiske@cweiske.de>
Sun, 6 Feb 2011 20:53:27 +0000 (21:53 +0100)
committerChristian Weiske <cweiske@cweiske.de>
Sun, 6 Feb 2011 20:53:27 +0000 (21:53 +0100)
munin/log-single-line.sh

index c32fa36110f1a03e9defd09b597aae38f2966c4b..fe730f3b74a7d93aab8dc310819969c2552ee8fa 100755 (executable)
@@ -16,6 +16,9 @@ fi
 
 while read -r line
 do
-    timestamp=`date +%s`
-    echo $line|sed "s/\$1;1;;/\$1;1;$timestamp;/" > "$file"
+    beginning=`echo "$line"|cut -b 1-3`
+    if [ "$beginning" = '$1;' ]; then
+        timestamp=`date +%s`
+        echo $line|sed "s/\$1;1;;/\$1;1;$timestamp;/" > "$file"
+    fi
 done