Hi All,

I am trying to search for multiple words in a text file. But it is not 
returning any output.

l*ogfile = "/home/weblogic/javaapp.txt"*
*java_count = 0*
*if File.exist? '/home/weblogic/javaapp.txt'*

*log = Facter::Util::FileRead.read(logfile)*
*unless log.nil?*
*log.each_line do |line|*
* case*
* when line.include?('/java')*
*java_count += 1*
* java_path = line.split(/ /)[0]*
*when line.include?('java version')*
*  java_version = line.split('"')[1]*
*Facter.add("java_u01_weblogic_foundversion#{java_count}u01_#{java_count}_path")
 
do*
* setcode do*
*    java_version + java_path*
*end*
*end*
*end*
*end*
*end*


But if use only one when statement it is working. Let me know search for 
two words at the same time?

Appreciate your help

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/b82feff6-3ce7-40b5-88d4-507975ec645a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to