# Elastic Agent shouldn't log httpjson pagination completion as an error

**URL:** <https://discuss.elastic.co/t/elastic-agent-shouldnt-log-httpjson-pagination-completion-as-an-error/353565>\
**Category:** Beats\
**Tags:** elastic-stack-security, filebeat\
**Created:** [February 19, 2024, 10:37am UTC](https://discuss.elastic.co/t/elastic-agent-shouldnt-log-httpjson-pagination-completion-as-an-error/353565 "2024-02-19T10:37:08Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![agmic](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/agmic/32/131874_2.png) [@agmic](https://discuss.elastic.co/u/agmic)\
**Post date:** [February 19, 2024, 10:37am UTC](https://discuss.elastic.co/t/elastic-agent-shouldnt-log-httpjson-pagination-completion-as-an-error/353565/1 "2024-02-19T10:37:08Z")

</div>

I think this is a bug, but seeking confirmation here before I raise it on github.

I am also not sure if this should be raised against Elastic Agent or the integration.

The Cisco Secure Endpoint integration collects event data via httpjson. The integration throws an error when it hits the last page, and this gets logged in the Elastic Agent error log with something similar to:  
`error processing response: template: :1:17: executing "" at <.last_response.body.metadata.links.next>: map has no entry for key "next"`

I believe you can see the fail condition prompting this at  
[integrations/packages/cisco\_secure\_endpoint/data\_stream/event/agent/stream/httpjson.yml.hbs at main · elastic/integrations (github.com)](https://github.com/elastic/integrations/blob/main/packages/cisco_secure_endpoint/data_stream/event/agent/stream/httpjson.yml.hbs) line 36-40

```auto
response.pagination:
- set:
    target: url.value
    value: '[[.last_response.body.metadata.links.next]]'
    fail_on_template_error: true

```

However, I assume this is expected behavior when reaching the last page of a response, and shouldn't present as an error in Elastic Agent on each run of the integration?

---

<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:** [March 18, 2024, 12:37pm UTC](https://discuss.elastic.co/t/elastic-agent-shouldnt-log-httpjson-pagination-completion-as-an-error/353565/2 "2024-03-18T12:37:21Z")

</div>

Closed on March 18, 2024, 12:37pm UTC

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