# Jump from trace-id in discovery mode to apm trace view

**URL:** <https://discuss.elastic.co/t/jump-from-trace-id-in-discovery-mode-to-apm-trace-view/235694>\
**Category:** APM\
**Tags:** java, ui\
**Created:** [June 4, 2020, 7:50am UTC](https://discuss.elastic.co/t/jump-from-trace-id-in-discovery-mode-to-apm-trace-view/235694 "2020-06-04T07:50:59Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![elk51211](https://avatars.discourse-cdn.com/v4/letter/e/ccd318/32.png) [@elk51211](https://discuss.elastic.co/u/elk51211)\
**Post date:** [June 4, 2020, 7:50am UTC](https://discuss.elastic.co/t/jump-from-trace-id-in-discovery-mode-to-apm-trace-view/235694/1 "2020-06-04T07:50:59Z")

</div>

I can use the Trace Overview to view the logs of a specific trace. Is it vice versa possible to use the trace ID in the discovery overview to display the corresponding trace in the APM App?  
In other words, with a respective shortcut and not via the filter- search function function in the APM App

---

<div class="post-metadata">

**Author:** ![felixbarny](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/felixbarny/32/27341_2.png) [@felixbarny](https://discuss.elastic.co/u/felixbarny)\
**Post date:** [June 4, 2020, 8:09am UTC](https://discuss.elastic.co/t/jump-from-trace-id-in-discovery-mode-to-apm-trace-view/235694/2 "2020-06-04T08:09:35Z")

</div>

Yes, that’s possible from within the actions menu of the logs app if your log has the trace.id field.

---

<div class="post-metadata">

**Author:** ![elk51211](https://avatars.discourse-cdn.com/v4/letter/e/ccd318/32.png) [@elk51211](https://discuss.elastic.co/u/elk51211)\
**Post date:** [June 4, 2020, 9:30am UTC](https://discuss.elastic.co/t/jump-from-trace-id-in-discovery-mode-to-apm-trace-view/235694/3 "2020-06-04T09:30:25Z")

</div>

How do I enable the trace.id field for my filebeat logs?  
Are there any specific settings I can adjust?

---

<div class="post-metadata">

**Author:** ![felixbarny](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/felixbarny/32/27341_2.png) [@felixbarny](https://discuss.elastic.co/u/felixbarny)\
**Post date:** [June 4, 2020, 10:45am UTC](https://discuss.elastic.co/t/jump-from-trace-id-in-discovery-mode-to-apm-trace-view/235694/4 "2020-06-04T10:45:40Z")

</div>

Refer to your specific agent’s log correlation documentation for that. For example [https://www.elastic.co/guide/en/apm/agent/java/current/log-correlation.html](https://www.elastic.co/guide/en/apm/agent/java/current/log-correlation.html)

---

<div class="post-metadata">

**Author:** ![elk51211](https://avatars.discourse-cdn.com/v4/letter/e/ccd318/32.png) [@elk51211](https://discuss.elastic.co/u/elk51211)\
**Post date:** [June 8, 2020, 12:18pm UTC](https://discuss.elastic.co/t/jump-from-trace-id-in-discovery-mode-to-apm-trace-view/235694/5 "2020-06-08T12:18:24Z")

</div>

I followed along the instructions.  
Added ECS-based logging for Java applications as:

```auto
<dependency>
      <groupId>co.elastic.logging</groupId>
      <artifactId>logback-ecs-encoder</artifactId>
      <version>0.4.0</version>
  </dependency>

```

Adjusted filebeat-config.yml:

```auto
filebeat.inputs:
  - type: container
    json:
      message_key: message
      keys_under_root: true
      overwrite_keys: true
      add_error_key: true
    multiline:
      pattern: '([0-9]{4}-[0-9]{2}-[0-9]{2}(T|\s)[0-9]{2}:[0-9]{2}:[0-9]{2}(\.[0-9]{3})?Z?)'
      negate: true
      match: after
    paths:
      - '/var/lib/docker/containers/*/*.log'
    processors:
      - add_docker_metadata: ~
output.elasticsearch:
  hosts: 
    - elasticsearch:9200
filebeat.config:
  modules:
    path: ${path.config}/modules.d/*.yml
    reload.enabled: false
filebeat.autodiscover:
  providers:
    - type: docker
      hints.enabled: true
      containers.ids:
        - "${data.docker.container.id}"
setup.kibana:
  host: "kibana:5601"

```

Added environment variable in my docker-compose file to the agent:  
`- "ELASTIC_APM_ENABLE_LOG_CORRELATION=true"`

Still no tracing.trace.id field logs in for spring boot application in the filebeat logs.  
do you have any idea what might have gone wrong?

---

<div class="post-metadata">

**Author:** ![felixbarny](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/felixbarny/32/27341_2.png) [@felixbarny](https://discuss.elastic.co/u/felixbarny)\
**Post date:** [June 8, 2020, 12:36pm UTC](https://discuss.elastic.co/t/jump-from-trace-id-in-discovery-mode-to-apm-trace-view/235694/6 "2020-06-08T12:36:39Z")

</div>

With that config you should be able to see field `"trace.id"` when executing `docker logs <container-id>`. Is that not the case?

Note that the `trace.id` will only be injected for lines logged within the context of a transaction. Are you seeing your transactions in the APM App? Which framework are you using? Spring boot?

---

<div class="post-metadata">

**Author:** ![elk51211](https://avatars.discourse-cdn.com/v4/letter/e/ccd318/32.png) [@elk51211](https://discuss.elastic.co/u/elk51211)\
**Post date:** [June 8, 2020, 1:34pm UTC](https://discuss.elastic.co/t/jump-from-trace-id-in-discovery-mode-to-apm-trace-view/235694/7 "2020-06-08T13:34:11Z")

</div>

No there is no trace.id in my docker logs spring-boot-app logs.  
I can see the transactions in the apm app.  
I'm using spring boot for the framework

---

<div class="post-metadata">

**Author:** ![felixbarny](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/felixbarny/32/27341_2.png) [@felixbarny](https://discuss.elastic.co/u/felixbarny)\
**Post date:** [June 8, 2020, 2:52pm UTC](https://discuss.elastic.co/t/jump-from-trace-id-in-discovery-mode-to-apm-trace-view/235694/8 "2020-06-08T14:52:17Z")

</div>

Could you share your debug logs as described here: [https://www.elastic.co/guide/en/apm/agent/java/current/trouble-shooting.html](https://www.elastic.co/guide/en/apm/agent/java/current/trouble-shooting.html)?

---

<div class="post-metadata">

**Author:** ![elk51211](https://avatars.discourse-cdn.com/v4/letter/e/ccd318/32.png) [@elk51211](https://discuss.elastic.co/u/elk51211)\
**Post date:** [June 11, 2020, 9:28am UTC](https://discuss.elastic.co/t/jump-from-trace-id-in-discovery-mode-to-apm-trace-view/235694/9 "2020-06-11T09:28:12Z")

</div>

I got transaction.id and trace.id in my filebeat message but no fields in kibana. What to do now?   
` {"@timestamp":"2020-06-11T09:25:28.500Z", "log.level":"DEBUG", "message":"Using 'application/json', given [*/*] and supported [application/json, application/*+json, application/json, application/*+json]", "service.name":"spring-template","event.dataset":"spring-template.log","process.thread.name":"http-nio-8080-exec-7","log.logger":"org.springframework.web.servlet.mvc.method.annotation.RequestResponseBodyMethodProcessor","transaction.id":"b8b21f97ff49f2ed","trace.id":"7576d6aa71bb5c7242b6a0c52df33d18"}`

---

<div class="post-metadata">

**Author:** ![felixbarny](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/felixbarny/32/27341_2.png) [@felixbarny](https://discuss.elastic.co/u/felixbarny)\
**Post date:** [June 12, 2020, 7:05am UTC](https://discuss.elastic.co/t/jump-from-trace-id-in-discovery-mode-to-apm-trace-view/235694/10 "2020-06-12T07:05:14Z")

</div>

Check out the recommended Filebeat configuration: [https://github.com/elastic/ecs-logging-java#step-3-filebeat-configuration](https://github.com/elastic/ecs-logging-java#step-3-filebeat-configuration)

---

<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 3, 2020, 3:05am UTC](https://discuss.elastic.co/t/jump-from-trace-id-in-discovery-mode-to-apm-trace-view/235694/11 "2020-07-03T03:05:16Z")

</div>

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