Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/postgresql/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Postgresql chef inspec输出中的regex函数_Postgresql_Chef Infra_Inspec - Fatal编程技术网

Postgresql chef inspec输出中的regex函数

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 (

我正在为postgressql使用chef inspec。 我正在执行下面的命令以匹配输出“local0”。因为输出可以是local0或local1等,所以给定%以匹配任何数值。但这是一个错误。请告知

  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)*$/}
结束