# Filebeat custom module for nodejs logs

**URL:** <https://discuss.elastic.co/t/filebeat-custom-module-for-nodejs-logs/142626>\
**Category:** Beats\
**Tags:** filebeat\
**Created:** [August 1, 2018, 4:49pm UTC](https://discuss.elastic.co/t/filebeat-custom-module-for-nodejs-logs/142626 "2018-08-01T16:49:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jogendra\_Jangid](https://avatars.discourse-cdn.com/v4/letter/j/5fc32e/32.png) [@Jogendra\_Jangid](https://discuss.elastic.co/u/Jogendra_Jangid)\
**Post date:** [August 1, 2018, 4:49pm UTC](https://discuss.elastic.co/t/filebeat-custom-module-for-nodejs-logs/142626/1 "2018-08-01T16:49:33Z")

</div>

Hi All,  
I trying to write a custom module for file beat that can send Nodejs application logs directory to elasticsearch. It's showing me below error on the execution using the plugin.

2018-08-01T22:05:12.348+0530 ERROR instance/beat.go:743 Exiting: Error getting config for fileset rb\_app\_logs/rb\_app\_stdout: Error interpreting the template of the input: template: text:3:22: executing "text" at \<.paths\>: range can't iterate over /tmp/abc.txt  
Exiting: Error getting config for fileset rb\_app\_logs/rb\_app\_stdout: Error interpreting the template of the input: template: text:3:22: executing "text" at \<.paths\>: range can't iterate over /tmp/abc.txt

**Sample log**  
cat /tmp/abc.log  
2018-08-01T10:57:58.976Z - debug: audit - API NOT WHITELISTED FOR AUDITING

**pipeline.json used in module**  
cat ingest/pipeline.json  
{  
"description": "Pipeline for parsing rb\_app\_logs rb\_app\_stdout logs",  
"processors": [{  
"grok": {  
"field": "message",  
"patterns":["%{TIMESTAMP\_ISO8601:rb\_app\_logs.rb\_app\_stdout.time} [0-9\-] %{LOGLEVEL:rb\_app\_logs.rb\_app\_stdout.loglevel}[:] %{GREEDYDATA:rb\_app\_logs.rb\_app\_stdout.message}"],  
"ignore\_missing": true,  
"pattern\_definitions": {  
"GREEDYMULTILINE": "(.|\n)\*"  
}  
}  
},  
{  
"remove": {  
"field": "message"  
}  
}],  
"on\_failure" : [{  
"set" : {  
"field" : "error.message",  
"value" : "{{ \_ingest.on\_failure\_message }}"  
}  
}]  
}

I have checked its working fine on elasticsearch pipeline simulator Other details as below.  
FIlebeat : 7.0.0-alpha1  
Elasticsearch:6.3.1

Thanks you  
Jogendra

---

<div class="post-metadata">

**Author:** ![Jogendra\_Jangid](https://avatars.discourse-cdn.com/v4/letter/j/5fc32e/32.png) [@Jogendra\_Jangid](https://discuss.elastic.co/u/Jogendra_Jangid)\
**Post date:** [August 1, 2018, 7:08pm UTC](https://discuss.elastic.co/t/filebeat-custom-module-for-nodejs-logs/142626/2 "2018-08-01T19:08:31Z")

</div>

Resolved My bad its configuration relented issue. Its not working with file located in /tmp

---

<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:** [August 29, 2018, 7:08pm UTC](https://discuss.elastic.co/t/filebeat-custom-module-for-nodejs-logs/142626/3 "2018-08-29T19:08:33Z")

</div>

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