# Multiple nodes of apis to scan

**URL:** <https://discuss.elastic.co/t/multiple-nodes-of-apis-to-scan/193538>\
**Category:** APM\
**Tags:** java, server, ui\
**Created:** [August 2, 2019, 1:00pm UTC](https://discuss.elastic.co/t/multiple-nodes-of-apis-to-scan/193538 "2019-08-02T13:00:31Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![hikozzaru](https://avatars.discourse-cdn.com/v4/letter/h/45deac/32.png) [@hikozzaru](https://discuss.elastic.co/u/hikozzaru)\
**Post date:** [August 2, 2019, 1:00pm UTC](https://discuss.elastic.co/t/multiple-nodes-of-apis-to-scan/193538/1 "2019-08-02T13:00:31Z")

</div>

**Kibana version** :  
7.2.0  
**APM Server version** :  
apm-server-7.2.0-x86\_64.rpm  
**APM Agent language and version** :  
elastic-apm-agent-1.7.0.jar  
**Original install method (e.g. download page, yum, deb, from source, etc.) and version**:  
curl -L -O [https://artifacts.elastic.co/downloads/apm-server/apm-server-7.2.0-x86\_64.rpm](https://artifacts.elastic.co/downloads/apm-server/apm-server-7.2.0-x86_64.rpm)  
sudo rpm -vi apm-server-7.2.0-x86\_64.rpm

[https://search.maven.org/search?q=a:elastic-apm-agent](https://search.maven.org/search?q=a:elastic-apm-agent)  
**Fresh install or upgraded from other version?**  
Fresh install  
**Is there anything special in your setup?**  
NO  
**Description of the problem including expected versus actual behavior. Please include screenshots (if relevant)**:

I have several applications that I want to monitor and each application also has different nodes. The problem is that the entire log goes to the main node and I want to see how each node behaves separately.

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/2/3/23ea9feb7e7e9143cc5b32717bffd38fd08bd9e5.png)

As we can see in the image, for example, there is authentication and authentication-api-node2 and as much as I use only node2 always the logs are directed to authentication. Each node internally in its properties is called as the original node, for example: authentication.

Then I will leave the fragment we use to start the services:

```
/usr/local/java/jdk1.8.0_171/bin/java '-XX:+UseG1GC -Xms512m -Xmx768m' -javaagent:/usr/local/elastic-apm-agent-1.7.0.jar \
    -Delastic.apm.service_name=authentication-api-node2 \
    -Delastic.apm.server_url=http://localhost:8200 \
    -Delastic.apm.secret_token= \
    -Delastic.apm.application_packages=com.digitalfactory.kerberos.authenticationapi \
    -jar /usr/local/project/api/authentication-api-node2/authentication-api-node2.jar \
    --spring.config.name=application,secrets \
    --spring.config.location=/usr/local/project/api/authentication-api-node2/application.properties,/usr/local/project/api/authentication-api-node2/secrets.properties \
    --spring.config.location=/usr/local/local_conf/master/jasypt.properties \
    --spring.cloud.bootstrap.location=/usr/local/local_conf/master/bootstrap-encryption.properties \
    --spring.config.location=/usr/local/local_conf/ssl.properties \
            > "/usr/local/logs/authentication-api-node2/authentication-api-node2-stdout.log" 2>&1 &

```

Internally for spring-boot each node of each api is called as its original node, example: all authentication-api nodes are called authentication, this is so that the eureka server can identify them and do the load balancing with ribbon.

**Errors in browser console (if relevant)**:  
No errors, just I want to know how to segregate logs according the node.

---

<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:** [August 2, 2019, 1:23pm UTC](https://discuss.elastic.co/t/multiple-nodes-of-apis-to-scan/193538/2 "2019-08-02T13:23:31Z")

</div>

> [@hikozzaru](#):
>
> Each node internally in its properties is called as the original node, for example: authentication.

Could you clarify where the name `authentication` is configured. Is it configured via `spring.application.name` in `application.properties`?

---

<div class="post-metadata">

**Author:** ![hikozzaru](https://avatars.discourse-cdn.com/v4/letter/h/45deac/32.png) [@hikozzaru](https://discuss.elastic.co/u/hikozzaru)\
**Post date:** [August 2, 2019, 1:24pm UTC](https://discuss.elastic.co/t/multiple-nodes-of-apis-to-scan/193538/3 "2019-08-02T13:24:47Z")

</div>

Hi @felixbarny, yes, it is configured via `spring.application.name` in `application.properties`

---

<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:** [August 2, 2019, 2:07pm UTC](https://discuss.elastic.co/t/multiple-nodes-of-apis-to-scan/193538/4 "2019-08-02T14:07:57Z")

</div>

Heh, that seems to be quite a funny edge case here. The value of the auto-detected service name (`authentication-api-node2.jar` -\> `authentication-api-node2`) is the same as the explicitly set value (`-Delastic.apm.service_name=authentication-api-node2`). That's why the agent thinks the agent name has not been set explicitly which makes it look for a more appropriate value, which it found via the `spring.application.name`.

I'll change the logic which detects whether the value has been explicitly set. In the mean time, just set the explicit service name to a value which is different than `authentication-api-node2`.

Alternatively, use `authentication` as the service name for all your nodes and use the `environment` setting to differ between them.

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [August 2, 2019, 2:17pm UTC](https://discuss.elastic.co/t/multiple-nodes-of-apis-to-scan/193538/5 "2019-08-02T14:17:54Z")

</div>

Also if you want to see the transactions aggregated sometimes and the separate other times you can always send them to the same transaction name then filter by `host.hostname` or some other field to then just see the transactions from a single host ..

See this post for some additional options

> [@APM - List services by host](https://discuss.elastic.co/t/apm-list-services-by-host/189018):
>
> Hello, First, I am very much an elastic newbie so please be gentle. I have managed to set up APM reporting on services and transactions for an application running on a Tomcat application server. We have the same application running on around 160 servers across multiple sites so we would need to be able to show overall performance of a service as well as on a per host basis. Can this be done and can someone point me in the right direction? Thanks

---

<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 23, 2019, 10:22am UTC](https://discuss.elastic.co/t/multiple-nodes-of-apis-to-scan/193538/6 "2019-08-23T10:22:19Z")

</div>

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