unixsock plugin et alii: Allow passing of arbitrary identifiers to the FLUSH command.
[collectd.git] / bindings / perl / Collectd / Unixsock.pm
index af274a5..da144e6 100644 (file)
@@ -471,6 +471,12 @@ sub flush
                        {
                                return;
                        }
+                       if ($ident_str =~ m/ /)
+                       {
+                               $ident_str =~ s#\\#\\\\#g;
+                               $ident_str =~ s#"#\\"#g;
+                               $ident_str = "\"$ident_str\"";
+                       }
 
                        $msg .= " identifier=$ident_str";
                }