# Conditional Output to http not working

**URL:** <https://discuss.elastic.co/t/conditional-output-to-http-not-working/115956>\
**Category:** Logstash\
**Created:** [January 17, 2018, 11:27pm UTC](https://discuss.elastic.co/t/conditional-output-to-http-not-working/115956 "2018-01-17T23:27:58Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![premkumar\_narashiman](https://avatars.discourse-cdn.com/v4/letter/p/6bbea6/32.png) [@premkumar\_narashiman](https://discuss.elastic.co/u/premkumar_narashiman)\
**Post date:** [January 17, 2018, 11:27pm UTC](https://discuss.elastic.co/t/conditional-output-to-http-not-working/115956/1 "2018-01-17T23:27:58Z")

</div>

Conditional Output to stdout or http not working consistently. Only one condition works and behavior seems to tied to input file that's getting updated first.

Does anyone see any issue with the configuration? please provide your inputs, i am new to ELK.

Logstash version: 6.1.0,

input {  
file {  
type =\> "xferlog"  
path =\> "/var/log/vsftpd/xferlog"  
id =\> "xfer"  
start\_position =\> "end"  
sincedb\_path =\> "/var/log/xfersincedb"  
stat\_interval =\> 0.1  
}  
file {  
type =\> "vsftpd"  
path =\> "/var/log/vsftpd.log"  
start\_position =\> "end"  
id =\> "vsftpd"  
sincedb\_path =\> "/var/log/vsftpdsincedb"  
stat\_interval =\> 0.1  
}  
file {  
type =\> "sftp"  
path =\> "/var/log/sftp/sftp.log"  
start\_position =\> "end"  
id =\> "sftp"  
sincedb\_path =\> "/var/log/sftpsincedb"  
stat\_interval =\> 0.1  
}  
}

output {

```
if [type] == "xferlog" {
         stdout { codec => json }
         http {
               http_method => "post"
               url => "http://localhost:xxxx/xferlog"
               id => "xfercall"
               automatic_retries => 5
               }
 }
else if [type] == "sftp" {
  stdout { codec => json }          
http {
               http_method => "post"
               url => "http://localhost:xxxx/sftplog"
               id => "sftpcall"
               automatic_retries => 5
               }

}
else if [type] == "vsftpd" {
        stdout { codec => json }
        http {
               http_method => "post"
               url => "http://localhost:xxxx/vsftpdsessionlog"
               id => "vsftpdcall"
               automatic_retries => 5
             }
}

```

}

---

<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:** [February 14, 2018, 11:27pm UTC](https://discuss.elastic.co/t/conditional-output-to-http-not-working/115956/2 "2018-02-14T23:27:59Z")

</div>

Closed on February 14, 2018, 11:27pm UTC

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