# Webhdfs output plugin does not create new files

**URL:** <https://discuss.elastic.co/t/webhdfs-output-plugin-does-not-create-new-files/36538>\
**Category:** Logstash\
**Created:** [December 7, 2015, 2:40pm UTC](https://discuss.elastic.co/t/webhdfs-output-plugin-does-not-create-new-files/36538 "2015-12-07T14:40:35Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Olaf\_Thormaehlen](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/olaf_thormaehlen/32/6486_2.png) [@Olaf\_Thormaehlen](https://discuss.elastic.co/u/Olaf_Thormaehlen)\
**Post date:** [December 7, 2015, 2:40pm UTC](https://discuss.elastic.co/t/webhdfs-output-plugin-does-not-create-new-files/36538/1 "2015-12-07T14:40:35Z")

</div>

Hi,

we have problems writing to hdfs via the webhdfs plugin. It does not create new files but will wirte to a file that does already exist. This prevents using tags like date, time, host and so on.

Does someone have the same problem and how do I solve this?

Thanks,

Olaf.

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [December 8, 2015, 3:48am UTC](https://discuss.elastic.co/t/webhdfs-output-plugin-does-not-create-new-files/36538/2 "2015-12-08T03:48:23Z")

</div>

Providing your config as well as what version you are running would help.

---

<div class="post-metadata">

**Author:** ![Olaf\_Thormaehlen](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/olaf_thormaehlen/32/6486_2.png) [@Olaf\_Thormaehlen](https://discuss.elastic.co/u/Olaf_Thormaehlen)\
**Post date:** [December 8, 2015, 6:55am UTC](https://discuss.elastic.co/t/webhdfs-output-plugin-does-not-create-new-files/36538/3 "2015-12-08T06:55:08Z")

</div>

Hi,

sorry. the config is pretty vanilla. The version is logstash 2.1 with webhdfs pulled from github (was not included in the "all-plugins" version).

the error message was

```
webhdfs write caused an exception: {"RemoteException":{"message":"Append failed for file: 
\/services\/logstash\/test.log, error: No such file or directory
(2)","exception":"IOException","javaClassName":"java.io.IOException"}}. Maybe you should increase retry_interval      
or reduce number of workers. Retrying... {:level=>:warn, :file=>"logstash/outputs/webhdfs.rb", :line=>"191",   
:method=>"write_data"}

```

until I created the file with "hadoop dfs -touchz /services/logstash/test.log". Then it worked.

```
input {
 log4j {
  mode => server
  host => "0.0.0.0"
  port => "4560"
  type => "log4j"
  }
}

output {
 webhdfs {
  host => "355.305.404.230"         
  port => "14000"
  path => "/services/logstash/test.log"  
  user => "hadoop"
}
```

---

<div class="post-metadata">

**Author:** ![ramu](https://avatars.discourse-cdn.com/v4/letter/r/e95f7d/32.png) [@ramu](https://discuss.elastic.co/u/ramu)\
**Post date:** [March 14, 2016, 10:16pm UTC](https://discuss.elastic.co/t/webhdfs-output-plugin-does-not-create-new-files/36538/4 "2016-03-14T22:16:09Z")

</div>

Hi,

I too face similar issue. Using webhdfs plugin in logstash to push a copy to HDFS.  
It does creates file with dynamic names[dd/mm/yy etc], but writes only first line. All subsequent logs that logstash tries to push results in same error as stated in this post.

When i use pre created file like test.log, it works smoothly. I went thru some posts and they are suggesting to close the HDFS file once created and reopen again for appending. I guess that is not working properly with the plugin.

Strangely when i make dfs.replication factor to 1, it does work in all scenarios. I am using HDP sandbox.

---

<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 6, 2017, 5:07am UTC](https://discuss.elastic.co/t/webhdfs-output-plugin-does-not-create-new-files/36538/5 "2017-07-06T05:07:04Z")

</div>


