Logstash creates switch case using ruby code

That ruby works just fine, although I would agree with Jenni that it is ugly and it would be better to do it with and if-else if-else if.

What does the rest of the ruby filter look like and what error message does it log?

You will get "comparison of String with 1000000 failed" if value is a type of String.