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 c32fa36..fe730f3 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