"Couldn't find any Elasticsearch dataYou'll need to index some data into Elasticsearch before you can create an index pattern " 这个问题出现的原因比较复杂,需要仔细排除,不过当出现这个问题的时候可以先看下Elasticsearch 是否含有数据,若是没有数据则添加数据即可。http://localhost:9200/_cat/indices。当这一步没问题了以后,若发现kibana还是无法显示数据则可以在kibana的DevTool里面直接模拟数据。如下:
<?xml version="1.0" encoding="UTF-8"?> <configuration> <includeresource="org/springframework/boot/logging/logback/defaults.xml" /> <springPropertyscope="context"name="springAppName"source="spring.application.name" /> <!-- Example for logging into the build folder of your project --> <propertyname="LOG_FILE"value="${BUILD_FOLDER:-build}/${springAppName}" /> <propertyname="CONSOLE_LOG_PATTERN" value="%clr(%d{yyyy-MM-dd HH:mm:ss}){faint} %clr(${LOG_LEVEL_PATTERN:-%5p}) %clr([${springAppName:-},%X{X-B3-TraceId:-},%X{X-B3-SpanId:-},%X{X-B3-ParentSpanId:-},%X{X-Span-Export:-}]){yellow} %clr(${PID:- }){magenta} %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}" />
<!-- Appender to log to console --> <appendername="console"class="ch.qos.logback.core.ConsoleAppender"> <filterclass="ch.qos.logback.classic.filter.ThresholdFilter"> <!-- Minimum logging level to be presented in the console logs --> <level>DEBUG</level> </filter> <encoder> <pattern>${CONSOLE_LOG_PATTERN}</pattern> <charset>utf8</charset> </encoder> </appender>