rsyslog 是否支持类似 C 的 case 语句?
switch ($programname)
{
case "nginx":
// code to be executed if n is equal to constant2;
break;
case "java":
// code to be executed if n is equal to constant2;
break;
...
default:
// code to be executed if n doesn't match any constant
break;
}
我知道通过 if..else if..else 语句可以达到相同的效果。