mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
Added IP to node description
This commit is contained in:
parent
9a30a42115
commit
24ff2f285d
1 changed files with 9 additions and 0 deletions
|
@ -35,6 +35,7 @@ import org.elasticsearch.common.logging.ESLogger;
|
|||
import org.elasticsearch.common.logging.ESLoggerFactory;
|
||||
import org.elasticsearch.common.network.NetworkUtils;
|
||||
import org.elasticsearch.common.settings.Settings;
|
||||
import org.elasticsearch.common.transport.InetSocketTransportAddress;
|
||||
import org.elasticsearch.common.unit.TimeValue;
|
||||
import org.elasticsearch.common.xcontent.ToXContent;
|
||||
import org.elasticsearch.common.xcontent.XContentBuilder;
|
||||
|
@ -287,6 +288,14 @@ public class ESExporter extends AbstractLifecycleComponent<ESExporter> implement
|
|||
builder.field("name", node.name());
|
||||
builder.field("transport_address", node.address());
|
||||
|
||||
if (node.address().uniqueAddressTypeId() == 1) { // InetSocket
|
||||
InetSocketTransportAddress address = (InetSocketTransportAddress) node.address();
|
||||
InetAddress inetAddress = address.address().getAddress();
|
||||
if (inetAddress != null) {
|
||||
builder.field("ip", inetAddress.getHostAddress());
|
||||
}
|
||||
}
|
||||
|
||||
if (hostname != null) {
|
||||
builder.field("hostname", hostname);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue