Postgresql chef inspec输出中的regex函数
我正在为postgressql使用chef inspec。 我正在执行下面的命令以匹配输出“local0”。因为输出可以是local0或local1等,所以给定%以匹配任何数值。但这是一个错误。请告知Postgresql chef inspec输出中的regex函数,postgresql,chef-infra,inspec,Postgresql,Chef Infra,Inspec,我正在为postgressql使用chef inspec。 我正在执行下面的命令以匹配输出“local0”。因为输出可以是local0或local1等,所以给定%以匹配任何数值。但这是一个错误。请告知 describe command("sudo -u postgres psql postgres -c \"show syslog_facility;\"") do its("stdout") { should match (
describe command("sudo -u postgres psql postgres -c \"show syslog_facility;\"") do
its("stdout") { should match ('local%') }
end
您需要编写一个符合您的条件的
下面的方法可能会奏效
descripe命令(“sudo-u postgres psql postgres-c\”show syslog\u facility;\“”)do
其(“标准输出”){应匹配/local(\d)*$/}
结束