# Logstash and since db permission

**URL:** <https://discuss.elastic.co/t/logstash-and-since-db-permission/346934>\
**Category:** Logstash\
**Created:** [November 12, 2023, 5:45pm UTC](https://discuss.elastic.co/t/logstash-and-since-db-permission/346934 "2023-11-12T17:45:22Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ranjini](https://avatars.discourse-cdn.com/v4/letter/r/898d66/32.png) [@ranjini](https://discuss.elastic.co/u/ranjini)\
**Post date:** [November 12, 2023, 5:45pm UTC](https://discuss.elastic.co/t/logstash-and-since-db-permission/346934/1 "2023-11-12T17:45:22Z")

</div>

Logstash runs as a container.logstash version 8.11.0  
Logstash input looks like the below

```auto
input {
  file {
    path => "/common/logs/parser-server-tasks-application/app.log"
    start_position => "beginning"
    sincedb_path => "/common/logs/.sincedb"
    type => "parser-server-tasks-application"
    codec => multiline {
      pattern => "^%{TIMESTAMP_ISO8601}"
      negate => true
      what => previous
      max_lines => 1000
    }
  }

```

I m using something called as hostpath(this path /folder is in container and as well on host where the container runs in kubernetes.)

permission /common chmod -R 777 /common

Everything works fine. I need logstash reads from /common/logs and write to sincedb.

but when I change the chmod -R 774 /common. Logstash fails.

```auto
Will restart this plugin.
  Pipeline_id:main
  Plugin: <LogStash::Inputs::File start_position=>"beginning", path=>["/common/logs/dp-cms-mw/*.jsonl"], codec=><LogStash::Codecs::JSON id=>"f057e2c0-d76d-4a5f-97ce-c19a37817c6d", enable_metric=>true, charset=>"UTF-8">, id=>"7c803fd8a4b19ca1aedcd08f1e639817309a4dec3c5b975fa81e8eae528a65fa", sincedb_path=>"/shared/logs/.sincedb_json", type=>"dp-cms-mw", enable_metric=>true, stat_interval=>1.0, discover_interval=>15, sincedb_write_interval=>15.0, delimiter=>"\n", close_older=>3600.0, mode=>"tail", file_completed_action=>"delete", sincedb_clean_after=>1209600.0, file_chunk_size=>32768, file_chunk_count=>140737488355327, file_sort_by=>"last_modified", file_sort_direction=>"asc", exit_after_read=>false, check_archive_validity=>false>
  Error: Permission denied - "/common/shared/logs/.sincedb_json
  Exception: Errno::EACCES

```

logstash container starts as a logstash user.

how to handle this scenario?

---

<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:** [November 12, 2023, 6:54pm UTC](https://discuss.elastic.co/t/logstash-and-since-db-permission/346934/2 "2023-11-12T18:54:05Z")

</div>

> [@ranjini](#):
>
> when I change the chmod -R 774 /common. Logstash fails.

Try 775. The user running logstash will need execute permission on the directory that contains the sincebd.

---

<div class="post-metadata">

**Author:** ![ranjini](https://avatars.discourse-cdn.com/v4/letter/r/898d66/32.png) [@ranjini](https://discuss.elastic.co/u/ranjini)\
**Post date:** [November 14, 2023, 7:15am UTC](https://discuss.elastic.co/t/logstash-and-since-db-permission/346934/3 "2023-11-14T07:15:56Z")

</div>

As per your suggestion chmod -R 775 works. However I tried with chmod -R 755 this one works fine. I don't see any error in logstash-plain.log.  
Than you @Badger adger for your insights.

---

<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:** [December 12, 2023, 7:16am UTC](https://discuss.elastic.co/t/logstash-and-since-db-permission/346934/4 "2023-12-12T07:16:00Z")

</div>

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