Created
January 8, 2013 13:21
-
-
Save kashyapp/4483775 to your computer and use it in GitHub Desktop.
Scrape nsca.log and generate carbon formatted strings
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl -w | |
use Sys::Hostname; | |
use Date::Parse; | |
# extract date string and time | |
# convert date string to epoch | |
# format string for carbon | |
# publish | |
m/\[(.*)\]:.*: (.*)s ;.*/; | |
$host = hostname; | |
$time = str2time($1); | |
print "sys.hostmetrics.$host.mysql.lag.per_min $2 $time\n"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment