Our Security Group would like to have complete visibility to logs in simple formats they can parse
and understand and socialize it to the C-suite with. Also, it can be used to analyze Puppet's proposed
operations in noop mode prior to an eventual turnup in full 7x24x365 mode for selected subsets of
our cloud.
--
You received this message because you are subscribed to a topic in the Google Groups "Puppet Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/puppet-users/GxeE-URziu8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to puppet-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/CAAJLFxVfb8A9TwsEng%2B2VK_eFarRa7a%3DkRMMGYu9hu%2BTvmBUGw%40mail.gmail.com.
--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/d333f68c-ad66-40bb-b969-9248114cd766%40googlegroups.com.
You received this message because you are subscribed to a topic in the Google Groups "Puppet Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/puppet-users/GxeE-URziu8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to puppet-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/52B0CA5A.2010505%40bericotechnologies.com.
[root@ca-sna-pm01 bin]# /usr/local/bin/yaml2csv.rb foobar.yml
./yaml2csv.rb:43: uninitialized constant Yaml2csv (NameError)
from /usr/lib/ruby/site_ruby/1.8/rubygems/core_ext/kernel_require.rb:45:in `gem_original_require'
from /usr/lib/ruby/site_ruby/1.8/rubygems/core_ext/kernel_require.rb:45:in `require'
from /usr/local/bin/yaml2csv.rb:7
[root@ca-sna-pm01 bin]#
Stuart
This is very interesting Jeff.I will play with it.Thanks!
Have you tried a yaml to csv converter like https://github.com/tokland/yaml2csv ? Note that it seems to require the csv module syntax from ruby 1.9.3.
Jeff
On 12/16/2013 03:29 PM, Stuart Cracraft wrote:
--Is the back-end piece of Puppet Dashboard which implements the CSV-capabilityof the YAML interpretation available as a standalone?
On Thursday, December 12, 2013 3:20:41 PM UTC-8, Stuart Cracraft wrote:
Hi everybody,
Is there a command-line program which parses:
puppetmasters*:/var/lib/puppet/reports/*/*.yaml
into simple a simple (though lengthy) report perhaps withcolumn/field/etc. selection based on a straightforward method.
Holler if you know of any. I know this was queried by meon this list recently and all sorts of stuff was posted. IfI don't get it here, I'll need to go over to puppet-developersand ask there.
Surely, someone has written something they're proud of andwill share it forward.
Stuart
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/d333f68c-ad66-40bb-b969-9248114cd766%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
--
You received this message because you are subscribed to a topic in the Google Groups "Puppet Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/puppet-users/GxeE-URziu8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to puppet-users+unsubscribe@googlegroups.com.
require 'puppet'
output = ""
# Are there args?
if defined?(ARGV)
# First argument needs to be the yaml file
filename = ARGV.first
# Has to be defined
if defined?(filename)
# Make a real version we can work on that is not frozen
fileName = filename.dup
# Get the report object
report = YAML.load_file(filename)
# Get the base name of the file to the far right
fileName = File.basename(filename)
# Formulate the timestamp
dateStamp = fileName.split /\./
# Loop through the logs and print appropriately
report.logs.each do |logg|
if logg.line or logg.line == 0 then
output = sprintf("%s, %s, %s, %s, (line %s), %s, %s, %s",
report.host,
dateStamp[0],
logg.time,
logg.file,
logg.line,
logg.source,
logg.level,
logg.message
)
searchResult = output.grep(/changed|noop/)
if searchResult.any? then
printf("%s\n",output)
end
else
output = sprintf("%s, %s, %s, %s, (line %s), %s, %s, %s",
report.host,
dateStamp[0],
logg.time,
logg.file,
"none",
logg.source,
logg.level,
logg.message
)
searchResult = output.grep(/changed|noop/)
if searchResult.any? then
printf("%s\n",output)
end
end
end
end
end