Too many if else if in output

Hi All

I am currently using Logstash version 7.4

My Logstash output is to Kusto. And it has the if-else condition on the output, for the different condition will output to different Kusto database.

The if-else checking is work, but the problem is the format ugly and when it displays on Kibana, it looks not so nice.

Here is my code

output {
    if [client] == "clientA"
      {
      kusto {
        path => "/etc/clientA.txt"
        database => "clientA
        }
      }
    else if [client] == "clientB"
      {
      kusto {
        path => "/etc/clientB.txt"
        database => "clientB
        }
      }
    else if [client] == "clientC"
      {
      kusto {
        path => "/etc/clientC.txt"
        database => "clientC
        }
      }
    else if [client] == "clientD"
      {
      kusto {
        path => "/etc/clientD.txt"
        database => "clientD
        }
      }
    else if [client] == "clientE"
      {
      kusto {
        path => "/etc/clientE.txt"
        database => "clientE
        }
      }
    else if [client] == "clientF"
      {
      kusto {
        path => "/etc/clientF.txt"
        database => "clientF
        }
      }

And here is my kibana

Any idea how to make it look nicer

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.