Hello All,
I am looking for a ansible module which can read /var/log/messages
I was using slurp but when the content of the /var/log/messages is quite long its not able to read the full content hence I made use of shell module like below
shell: grep /var/log/messages
but the ask is to find out the way to make use of module only. hence is there any module apart from slurp and shell which can read the file content and register it?
NOTE: for lookup I was not able to read /var/log/messages with type as file and there is nothing as log available
Regards
AC
Registering the entire /var/log/messages in a variable sounds like a bad idea.
I see you are already grepping for strings?
What is it that you are really looking for? What are you trying to accomplish?
Hello Dick,
Task is to look for a particular keyword after a software has install and license is acquired in the log file /var/log/messages
Example: date xyz: license acquired
So currently I am using shell as below
Shell: grep xyz /var/log/message
Register: output
And then doing assert to look for license acquired in output.stdout
Above works perfectly.
But I am looking for a way to achieve this using other module and not the shell module
Regards
AC
Is this some license key or something?
Either way, if this software can only send it to the system log, then
in this case shell+grep is probably the best option.