# Permission error for custom log integration on Fleet-managed Agent

**URL:** <https://discuss.elastic.co/t/permission-error-for-custom-log-integration-on-fleet-managed-agent/287486>\
**Category:** Beats\
**Tags:** elastic-agent\
**Created:** [October 23, 2021, 9:36am UTC](https://discuss.elastic.co/t/permission-error-for-custom-log-integration-on-fleet-managed-agent/287486 "2021-10-23T09:36:22Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Panagiota\_Mitsopoulo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/panagiota_mitsopoulo/32/84948_2.png) [@Panagiota\_Mitsopoulo](https://discuss.elastic.co/u/Panagiota_Mitsopoulo)\
**Post date:** [October 23, 2021, 9:36am UTC](https://discuss.elastic.co/t/permission-error-for-custom-log-integration-on-fleet-managed-agent/287486/1 "2021-10-23T09:36:22Z")

</div>

Hello!

I have a Nodejs app that ingests logs into Elasticsearch Service deployment 7.15.1 using Filebeat. More of less this is the example I've been doing adapted to my needs [Ingest logs from a Node.js web application using Filebeat | Elasticsearch Service Documentation | Elastic](https://www.elastic.co/guide/en/cloud/current/ec-getting-started-search-use-cases-node-logs.html) and everything works fine.

Now I am trying to use Fleet and Elastic agent to send my custom json logs but here's the error I got:

`[elastic_agent.filebeat][error] Harvester could not be started on new file: /Users/panagiotamitsopoulou/Documents/HYF/nodejs_ES_logs/logs/log.json, Err: error setting up harvester: Harvester setup failed. Unexpected file opening error: Failed opening /Users/panagiotamitsopoulou/Documents/HYF/nodejs_ES_logs/logs/log.json: open /Users/panagiotamitsopoulou/Documents/HYF/nodejs_ES_logs/logs/log.json: operation not permitted.`

I am on Mac and here are the steps I've taken.

- On Kibana \> Fleet I verified that my agent with Elastic Cloud agent policy is Healthy
- I enabled Collect agent logs under Elastic Cloud agent policy
- I created a new Fleet-managed agent and installed the agent to my machine with the `sudo ./elastic-agent install -f ....` I copied from the UI.
- I did `chmod -R 777 logs`
- I keep getting the permission error I wrote above

How can I solve above issue or better how can I troubleshoot if I am doing something wrong or if it is actually a bug?

A couple more questions since I would like to demonstrate above example to an audience if I manage to make it work and I would like to know how it actually works:

- Enabling `Collect agent logs` under Elastic Cloud agent policy is a prerequisite mandatory step I need to do to be able to send custom logs?
- Do I need to add anything else in my custom configuration?  
 ![Screenshot 2021-10-23 at 11.33.18](https://us1.discourse-cdn.com/elastic/original/3X/0/d/0d7991f5de15e3fe59b81344b2b11b12137ad62e.png)
- I found a similar post [Adding config for custom log integration on an agent](https://discuss.elastic.co/t/adding-config-for-custom-log-integration-on-an-agent/262181), where these two configuration options are mentioned `agent.logging.json` and `agent.logging.ecs`. Do I need to update them? If yes where is the installed path of my agent to do so?

If needed I could share the github link of my code.

Thanks,  
Panagiota

---

<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:** [November 20, 2021, 11:36am UTC](https://discuss.elastic.co/t/permission-error-for-custom-log-integration-on-fleet-managed-agent/287486/2 "2021-11-20T11:36:38Z")

</div>

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