# Structured JSON logs via ElasticAgent Kubernetes Integration

**URL:** <https://discuss.elastic.co/t/structured-json-logs-via-elasticagent-kubernetes-integration/326809>\
**Category:** Elastic Observability\
**Created:** [March 1, 2023, 11:23pm UTC](https://discuss.elastic.co/t/structured-json-logs-via-elasticagent-kubernetes-integration/326809 "2023-03-01T23:23:59Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![metalp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/metalp/32/117926_2.png) [@metalp](https://discuss.elastic.co/u/metalp)\
**Post date:** [March 1, 2023, 11:23pm UTC](https://discuss.elastic.co/t/structured-json-logs-via-elasticagent-kubernetes-integration/326809/1 "2023-03-01T23:23:59Z")

</div>

We're adopting Elastic stack to log our Kubernetes applications. We have installed ElasticAgent into our cluster via the Fleet managed manifest:

[https://raw.githubusercontent.com/elastic/elastic-agent/master/deploy/kubernetes/elastic-agent-managed-kubernetes.yaml](https://raw.githubusercontent.com/elastic/elastic-agent/master/deploy/kubernetes/elastic-agent-managed-kubernetes.yaml)

We are using the default Kubernetes Elastic Agent integration / policy to grab the container logs. We're outputting structured JSON logs using golang / zap + the ecszap package. Kibana is correctly pulling these in.

The problem:

The JSON logs are not being parsed, the JSON object is just being added as a string. I understand from reading that the ElasticAgent integration will pull the logs in as "Container Logs" and not JSON.

I cannot figure out how to have ElasticAgent pull the ecszap logs in as structured logs. The ElasticAgent / Kubernetes integration gives no information, and I can't find any tutorials. I am meant to use the hints on the pod annonations to get this to work?
