# Too many if else if in output

**URL:** <https://discuss.elastic.co/t/too-many-if-else-if-in-output/236441>\
**Category:** Logstash\
**Created:** [June 10, 2020, 6:21am UTC](https://discuss.elastic.co/t/too-many-if-else-if-in-output/236441 "2020-06-10T06:21:32Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![cling1988](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cling1988/32/84008_2.png) [@cling1988](https://discuss.elastic.co/u/cling1988)\
**Post date:** [June 10, 2020, 6:21am UTC](https://discuss.elastic.co/t/too-many-if-else-if-in-output/236441/1 "2020-06-10T06:21:32Z")

</div>

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

```auto
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

 ![Capture](https://us1.discourse-cdn.com/elastic/original/3X/3/7/372cef23243508696c32571e9536a261f5d56ef6.png)

Any idea how to make it look nicer

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 8, 2020, 6:21am UTC](https://discuss.elastic.co/t/too-many-if-else-if-in-output/236441/2 "2020-07-08T06:21:33Z")

</div>

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