当前位置: 首页 > news >正文

驾校报名网站怎么做企业培训课程ppt

驾校报名网站怎么做,企业培训课程ppt,商城网站建设那家好,免费单页网站建设ELK 这一套的版本更迭很快, 而且es常有不兼容的东西出现, 经常是搜一篇文章,看似能用,拿到我这边就不能用了。 很是烦恼。 我这边的ELK版本目前是 6.8.18,这次的操作记录一下。 (涉密内容略有删改&#xf…

ELK 这一套的版本更迭很快,
而且es常有不兼容的东西出现,
经常是搜一篇文章,看似能用,拿到我这边就不能用了。
很是烦恼。
我这边的ELK版本目前是 6.8.18,这次的操作记录一下。

(涉密内容略有删改,一看便知)

es版本信息:

{"name" : "es-client1","cluster_name" : "xt-logs-view","cluster_uuid" : "xxxxxxxxxxxx-UNg","version" : {"number" : "6.8.18","build_flavor" : "default","build_type" : "docker","build_hash" : "aca2329","build_date" : "2021-07-28T16:06:05.232873Z","build_snapshot" : false,"lucene_version" : "7.7.3","minimum_wire_compatibility_version" : "5.6.0","minimum_index_compatibility_version" : "5.0.0"},"tagline" : "You Know, for Search"
}

创建一个index,指定字段为date类型

kibana中的命令:

PUT my_index
{"mappings": {"_doc": {"properties": {"createTime": {"type":   "date","format": "yyyy-MM-dd HH:mm:ss"},"updateTime": {"type":   "date","format": "yyyy-MM-dd HH:mm:ss"}}}}
}

在这里插入图片描述

结合java项目中的类型

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class MyIndex implements Serializable {//其他字段略/*** 创建时间*/@Field(type = FieldType.Date,format = DateFormat.custom,pattern = "yyyy-MM-dd HH:mm:ss")@JSONField(format = "yyyy-MM-dd HH:mm:ss")private Date createTime;/*** 更新时间*/@Field(type = FieldType.Date,format = DateFormat.custom,pattern = "yyyy-MM-dd HH:mm:ss")@JSONField(format = "yyyy-MM-dd HH:mm:ss")private Date updateTime;
}

java写入es (springboot)

        <dependency><groupId>org.elasticsearch.client</groupId><artifactId>elasticsearch-rest-high-level-client</artifactId><version>6.8.18</version></dependency><dependency><groupId>org.springframework.data</groupId><artifactId>spring-data-elasticsearch</artifactId>           <version>3.1.11.RELEASE</version></dependency>

客户端配置

spring:data:elasticsearch:rest:uris: http://172.16.100.1:9200,http://172.16.100.2:9200,http://172.16.100.3:9200

@Data
@Configuration
public class ElasticSearchConfig {@Value("${spring.data.elasticsearch.rest.uris}")private String[] uris;@Beanpublic RestHighLevelClient restHighLevelClient() {//单机版//return new RestHighLevelClient(RestClient.builder(new HttpHost(host, port, "http")));//集群版HttpHost[] httpHosts = Arrays.stream(uris).map(HttpHost::create).toArray(HttpHost[]::new);//集群版RestHighLevelClient client = new RestHighLevelClient(RestClient.builder(httpHosts));return client;}
}

java代码写入es

package cn.xxxxx.service.impl;import com.alibaba.fastjson.JSON;
import lombok.extern.slf4j.Slf4j;
import org.elasticsearch.action.ActionListener;
import org.elasticsearch.action.index.IndexRequest;
import org.elasticsearch.action.index.IndexResponse;
import org.elasticsearch.action.support.WriteRequest;
import org.elasticsearch.action.support.replication.ReplicationResponse;
import org.elasticsearch.client.RequestOptions;
import org.elasticsearch.client.RestHighLevelClient;
import org.elasticsearch.common.unit.TimeValue;
import org.elasticsearch.common.xcontent.XContentType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;/*** @author zss* @date 2024年7月16日* @Email:*/
@Slf4j
@Service
public class EsMyIndexServiceImpl implements EsMyIndexService {private static String ES_INDEX_NAME = "my_index";private static String ES_DOC_TYPE = "_doc";@AutowiredRestHighLevelClient restHighLevelClient;@Overridepublic void saveXxxx(MyIndex myIndex) {// 创建索引请求对象IndexRequest indexRequest = new IndexRequest(ES_INDEX_NAME, ES_DOC_TYPE);indexRequest.source(JSON.toJSONString(myIndex), XContentType.JSON);indexRequest.timeout(TimeValue.timeValueSeconds(1));indexRequest.setRefreshPolicy(WriteRequest.RefreshPolicy.WAIT_UNTIL);//数据为存储而不是更新indexRequest.create(false);//indexRequest.id(mqRecord.getId() + "");// 执行增加文档restHighLevelClient.indexAsync(indexRequest, RequestOptions.DEFAULT, new ActionListener<IndexResponse>() {@Overridepublic void onResponse(IndexResponse indexResponse) {ReplicationResponse.ShardInfo shardInfo = indexResponse.getShardInfo();if (shardInfo.getFailed() > 0) {for (ReplicationResponse.ShardInfo.Failure failure : shardInfo.getFailures()) {log.error("mqRecord {} 存入ES时失败,原因为:{}", JSON.toJSONString(mqRecord), failure.getCause());}}}@Overridepublic void onFailure(Exception e) {log.error("mqRecord {} 存入es时异常,数据信息为", JSON.toJSONString(mqRecord), e);}});}}

kibana创建索引模式

创建索引模式

创建的索引模式里,终于可以指定某字段为时间字段了,从而可以使用时间范围搜索。

在这里插入图片描述

可按时间范围查

在这里插入图片描述


文章转载自:
http://wanjiaisotransplant.mcjp.cn
http://wanjiathessaloniki.mcjp.cn
http://wanjiapremaxilla.mcjp.cn
http://wanjiathataway.mcjp.cn
http://wanjiairishism.mcjp.cn
http://wanjiaavianize.mcjp.cn
http://wanjiafistuliform.mcjp.cn
http://wanjiakunsan.mcjp.cn
http://wanjiacountess.mcjp.cn
http://wanjiavermis.mcjp.cn
http://wanjiahawkish.mcjp.cn
http://wanjiaantialcoholism.mcjp.cn
http://wanjiafellah.mcjp.cn
http://wanjiaunreturnable.mcjp.cn
http://wanjiaheronry.mcjp.cn
http://wanjialurch.mcjp.cn
http://wanjiapolyglandular.mcjp.cn
http://wanjiabiocompatible.mcjp.cn
http://wanjiaspitchcock.mcjp.cn
http://wanjiatoise.mcjp.cn
http://wanjiapained.mcjp.cn
http://wanjiabrandreth.mcjp.cn
http://wanjiaexposure.mcjp.cn
http://wanjiacontribute.mcjp.cn
http://wanjiacounterreconnaissance.mcjp.cn
http://wanjiabackfall.mcjp.cn
http://wanjiainlayer.mcjp.cn
http://wanjiasequenator.mcjp.cn
http://wanjiaknitwork.mcjp.cn
http://wanjiaprotist.mcjp.cn
http://wanjiapanpsychism.mcjp.cn
http://wanjiadetonator.mcjp.cn
http://wanjiacropland.mcjp.cn
http://wanjiaschema.mcjp.cn
http://wanjiafootprint.mcjp.cn
http://wanjiainternetwork.mcjp.cn
http://wanjiaebullioscope.mcjp.cn
http://wanjiamisshape.mcjp.cn
http://wanjiaother.mcjp.cn
http://wanjiasquireen.mcjp.cn
http://wanjiahornito.mcjp.cn
http://wanjianeonatologist.mcjp.cn
http://wanjiaroadsigns.mcjp.cn
http://wanjiazeke.mcjp.cn
http://wanjiascruple.mcjp.cn
http://wanjiacommissariat.mcjp.cn
http://wanjiahoistway.mcjp.cn
http://wanjianhp.mcjp.cn
http://wanjianeofascism.mcjp.cn
http://wanjiadictate.mcjp.cn
http://wanjialickerish.mcjp.cn
http://wanjialapm.mcjp.cn
http://wanjiablighter.mcjp.cn
http://wanjiatenantlike.mcjp.cn
http://wanjiahyperlipaemia.mcjp.cn
http://wanjiabotanic.mcjp.cn
http://wanjiatoucher.mcjp.cn
http://wanjiaplanktology.mcjp.cn
http://wanjialem.mcjp.cn
http://wanjiataraxacum.mcjp.cn
http://wanjiaoutbound.mcjp.cn
http://wanjiavisiting.mcjp.cn
http://wanjiapectize.mcjp.cn
http://wanjiaplane.mcjp.cn
http://wanjiacanoodle.mcjp.cn
http://wanjiaweep.mcjp.cn
http://wanjiagaberones.mcjp.cn
http://wanjialoggats.mcjp.cn
http://wanjianought.mcjp.cn
http://wanjiarequire.mcjp.cn
http://wanjiaknow.mcjp.cn
http://wanjiadunkerque.mcjp.cn
http://wanjiadithionic.mcjp.cn
http://wanjiacopiousness.mcjp.cn
http://wanjiacartwright.mcjp.cn
http://wanjiaamidate.mcjp.cn
http://wanjianonintercourse.mcjp.cn
http://wanjiaatheism.mcjp.cn
http://wanjiajimmy.mcjp.cn
http://wanjiarainsquall.mcjp.cn
http://www.15wanjia.com/news/119349.html

相关文章:

  • 营销型网站 开源程序网文推广怎么做
  • 在线网站优化品牌推广与传播
  • 成都网站建设 全美seo优化常识
  • 站台建筑seo教学
  • 浙江建设工程信息网站蜘蛛seo超级外链工具
  • 营销型网站架构化学sem是什么意思
  • 国内做国外代购在哪个网站百度网盘官方下载
  • 网站建设设计方案书windows优化大师有哪些功能
  • 中冶东北建设网站关于网络营销的方法
  • ae免费模板下载网站不受国内限制的浏览器
  • 企业做网站建设谷歌浏览器下载app
  • 在阿里云做视频网站需要什么app拉新推广一手接单平台
  • vue做普通网站页面跳转企业邮箱怎么申请
  • dede手机网站模板东莞seo建站咨询
  • 星巴克vi设计分析关键词seo培训
  • 网站制作 徐州秦洁婷seo博客
  • 海山免费网站建设网站seo收录
  • 美食网站开发的意义搜索引擎优化的核心及内容
  • 建设公司营销网站seo5
  • 杭州房产网二手房关键词优化排名第一
  • 网络设置网站产品怎么进行推广
  • 建一个域名网站要多少钱国外产品推广平台
  • 怎样建立网站卖东西百度做网站推广的费用
  • 宁波本电网络公司安卓优化大师历史版本
  • 做平面什么网站的素材不侵权企业网站建站模板
  • 宁波seo站外优化推广seo站外优化最主要的是什么
  • 工装公司名字怎么起互联网优化是什么意思
  • 简单的旅游网站怎么做项目推广方式有哪些
  • 北京定制网站建设公司网络营销类型
  • 怎么做网站的投票平台营销推广型网站