# With variable output file name : "The starting part of the path should not be dynamic"

**URL:** <https://discuss.elastic.co/t/with-variable-output-file-name-the-starting-part-of-the-path-should-not-be-dynamic/127966>\
**Category:** Logstash\
**Created:** [April 13, 2018, 11:41am UTC](https://discuss.elastic.co/t/with-variable-output-file-name-the-starting-part-of-the-path-should-not-be-dynamic/127966 "2018-04-13T11:41:19Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![AJ\_NOURI](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aj_nouri/32/29741_2.png) [@AJ\_NOURI](https://discuss.elastic.co/u/AJ_NOURI)\
**Post date:** [April 13, 2018, 11:41am UTC](https://discuss.elastic.co/t/with-variable-output-file-name-the-starting-part-of-the-path-should-not-be-dynamic/127966/1 "2018-04-13T11:41:19Z")

</div>

When I add a output file with variable in the **pipiline.conf**

`path => "%{type}_%{+yyyy_MM_dd}.log"`

I get the logstash error :

> The starting part of the path should not be dynamic

It works fine when I remove the path line or without variable name:

`path => "access.log"`

Here is the pipelines.conf

```
input {
    file {
        path => "/mylogstash/data/apache_access.log"
        start_position => "beginning"
        type => "access"
    }
    http {
        type => "access"
    }
}
filter {
    grok {
    match => { "message" => '%{HTTPD_COMMONLOG} "%{GREEDYDATA:referrer}" "%{GREEDYDATA:agent}"' }
    }
    mutate {
        convert => {
            "response" => "integer"
            "bytes" => "integer"
        }
    }
}
output {
    stdout {
        codec => rubydebug
    }
    file {
        path => "%{type}_%{+yyyy_MM_dd}.log"
    }
}

```

Any hint?

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [April 13, 2018, 11:54am UTC](https://discuss.elastic.co/t/with-variable-output-file-name-the-starting-part-of-the-path-should-not-be-dynamic/127966/2 "2018-04-13T11:54:14Z")

</div>

You can't begin the path with `%{whatever}`. It must begin with something non-dynamic.

---

<div class="post-metadata">

**Author:** ![AJ\_NOURI](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aj_nouri/32/29741_2.png) [@AJ\_NOURI](https://discuss.elastic.co/u/AJ_NOURI)\
**Post date:** [April 13, 2018, 12:04pm UTC](https://discuss.elastic.co/t/with-variable-output-file-name-the-starting-part-of-the-path-should-not-be-dynamic/127966/3 "2018-04-13T12:04:03Z")

</div>

Thanks @magnusbaeck for your prompt reply, appreciate it.

Indeed, I added the absolute path to the beginning of the file and the error disapeared

```
file {
    path => "/data/%{type}_%{+yyyy_MM_dd}.log"
}

```

Thanks a lot!!

---

<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:** [May 11, 2018, 12:04pm UTC](https://discuss.elastic.co/t/with-variable-output-file-name-the-starting-part-of-the-path-should-not-be-dynamic/127966/4 "2018-05-11T12:04:04Z")

</div>

Closed on May 11, 2018, 12:04pm UTC

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