# Logstash 8.1.1 with file input plugin hangs

**URL:** <https://discuss.elastic.co/t/logstash-8-1-1-with-file-input-plugin-hangs/300789>\
**Category:** Logstash\
**Created:** [March 27, 2022, 10:27pm UTC](https://discuss.elastic.co/t/logstash-8-1-1-with-file-input-plugin-hangs/300789 "2022-03-27T22:27:30Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![geena.rollins](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/geena.rollins/32/15661_2.png) [@geena.rollins](https://discuss.elastic.co/u/geena.rollins)\
**Post date:** [March 27, 2022, 10:27pm UTC](https://discuss.elastic.co/t/logstash-8-1-1-with-file-input-plugin-hangs/300789/1 "2022-03-27T22:27:30Z")

</div>

On Amazon Linux 2 AMI (HVM) - Kernel 5.10, I installed Java-17, Elasticsearch 8.1.1, and Logstash 8.1.1. When I use the file input plugin, logstash hangs.

logstash.yml is  
`node.name: tester`

file.conf is

```auto
input {
    file {
    	 path => ["/opt/logstash-8.1.1/hello.json"]
	 start_position => "beginning"
	 ignore_older => 0
	 type => "json"
    }
}
output {
  stdout { codec => rubydebug }
}

```

hello.json is  
`{ "x": "Hello, world!!!", "y": 7 }`

```auto
[2022-03-27T22:10:29,462][INFO][logstash.inputs.file][main] No sincedb_path set, generating one based on the "path" setting {:sincedb_path=>"/opt/ls/data/plugins/inputs/file/.sincedb_f6518be85b0684a29aca5c2807851c39", :path=>["/opt/logstash-8.1.1/hello.json"]}
...
[2022-03-27T22:18:15,436][INFO][filewatch.observingtail][main][d11e930b2ac8ef6145488d50ae6b014fac82c31a52f52572afac148e286d6054] START, creating Discoverer, Watch with file and sincedb collections

```

I've tried this with and without ignore\_older. Using input { stdin { } }, logstash reads hello.json fine. I've tried this on my macbook monterey 12.2.1 with the same results.

Thank you for your advice.

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [March 27, 2022, 11:16pm UTC](https://discuss.elastic.co/t/logstash-8-1-1-with-file-input-plugin-hangs/300789/2 "2022-03-27T23:16:37Z")

</div>

two quick things to check

1. Is there a newline after that first line in your file hello.json? Pretty sure the file input is  
Oriented so it needs a new line to process the line.

2. now that it's tried to read The file once you will need to clean out since\_db because even though you say start at the beginning, it will only read a file once. That's how log stash doesn't keep reading the same file over and over again.

You can set

sincedb\_path =\> "/dev/null"

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [March 27, 2022, 11:31pm UTC](https://discuss.elastic.co/t/logstash-8-1-1-with-file-input-plugin-hangs/300789/3 "2022-03-27T23:31:02Z")

</div>

> [@geena.rollins](#):
>
> `ignore_older => 0`

For filebeat, setting ignore\_older to zero disables filtering by age. In a file input, it causes the input to ignore files more than zero seconds old, so it ignores all files.

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [March 27, 2022, 11:34pm UTC](https://discuss.elastic.co/t/logstash-8-1-1-with-file-input-plugin-hangs/300789/4 "2022-03-27T23:34:51Z")

</div>

Today I learned! Thanks Mr B!

---

<div class="post-metadata">

**Author:** ![geena.rollins](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/geena.rollins/32/15661_2.png) [@geena.rollins](https://discuss.elastic.co/u/geena.rollins)\
**Post date:** [March 28, 2022, 12:38am UTC](https://discuss.elastic.co/t/logstash-8-1-1-with-file-input-plugin-hangs/300789/5 "2022-03-28T00:38:43Z")

</div>

Today I learned! Thanks both Mr Bs!

```auto
input {
    file {
    	 path => ["/opt/logstash-8.1.1/hello.json"]
	 start_position => "beginning"
	 type => "json"
	 sincedb_path => "/dev/null"
    }
}

output {
  stdout { codec => rubydebug }
}

```

---

<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:** [April 25, 2022, 12:39am UTC](https://discuss.elastic.co/t/logstash-8-1-1-with-file-input-plugin-hangs/300789/6 "2022-04-25T00:39:21Z")

</div>

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