-1

Does rsyslog support case statement similar to C?

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;
}

I know that same effect can be achieved by if..else if..else statement.

foxtrot9
  • 103
  • 1

1 Answers1

0

No, it doesn't, as you can easily learn yourself: https://www.rsyslog.com/doc/v8-stable/rainerscript/control_structures.html

Sven
  • 98,649
  • 14
  • 180
  • 226
  • I read the same documentation before asking the question. But I was skeptical that it might be buried somewhere else in documentation. – foxtrot9 Dec 12 '18 at 11:36