# Getting different log path from API

**URL:** <https://discuss.elastic.co/t/getting-different-log-path-from-api/32974>\
**Category:** Logstash\
**Created:** [October 26, 2015, 10:44am UTC](https://discuss.elastic.co/t/getting-different-log-path-from-api/32974 "2015-10-26T10:44:52Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Navneet\_Mathpal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/navneet_mathpal/32/3677_2.png) [@Navneet\_Mathpal](https://discuss.elastic.co/u/Navneet_Mathpal)\
**Post date:** [October 26, 2015, 10:44am UTC](https://discuss.elastic.co/t/getting-different-log-path-from-api/32974/1 "2015-10-26T10:44:52Z")

</div>

Hi,

I have a requirement where I need to get the file path from an API, I am getting the API in json format , which contains file path, location, etc.  
ex-

> [{  
> "filepath" : "d:/systemlogs/systemlog-12-jan-2015",  
> "errortype" : "systemErrors"  
> }  
> {  
> "filepath" : "d:/MONGOlog/mongoLOG-12-jan-2015",  
> "errortype" : "mongoLog"  
> }]

How can I achieve this, as file path does not gives the flexibility to give the relative path , or path from an API,  
Any idea how it can be achieved ?

Best Regards,  
Navneet

---

<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:** [October 26, 2015, 10:46am UTC](https://discuss.elastic.co/t/getting-different-log-path-from-api/32974/2 "2015-10-26T10:46:03Z")

</div>

Logstash doesn't support this. You either need to write a custom input plugin or generate the config file dynamiclly and restart Logstash as necessary.

---

<div class="post-metadata">

**Author:** ![Navneet\_Mathpal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/navneet_mathpal/32/3677_2.png) [@Navneet\_Mathpal](https://discuss.elastic.co/u/Navneet_Mathpal)\
**Post date:** [October 27, 2015, 6:51am UTC](https://discuss.elastic.co/t/getting-different-log-path-from-api/32974/3 "2015-10-27T06:51:20Z")

</div>

Thank you @magnusbaeck..

How we can dynamically generate the conf file ?

Thanks,  
Navneet

---

<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:** [October 27, 2015, 7:12am UTC](https://discuss.elastic.co/t/getting-different-log-path-from-api/32974/4 "2015-10-27T07:12:32Z")

</div>

> How we can dynamically generate the conf file ?

By writing a script in any language that you're comfortable with?

---

<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:25am UTC](https://discuss.elastic.co/t/getting-different-log-path-from-api/32974/5 "2017-07-06T05:25:20Z")

</div>


