惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

宝玉的分享
宝玉的分享
NISL@THU
NISL@THU
E
Exploit-DB.com RSS Feed
L
LINUX DO - 热门话题
L
Lohrmann on Cybersecurity
K
Kaspersky official blog
Project Zero
Project Zero
Cisco Talos Blog
Cisco Talos Blog
T
The Exploit Database - CXSecurity.com
P
Palo Alto Networks Blog
C
CXSECURITY Database RSS Feed - CXSecurity.com
T
Threatpost
S
Schneier on Security
G
GRAHAM CLULEY
The Hacker News
The Hacker News
T
Threat Research - Cisco Blogs
Scott Helme
Scott Helme
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
P
Privacy & Cybersecurity Law Blog
C
Cyber Attacks, Cyber Crime and Cyber Security
Cyberwarzone
Cyberwarzone
C
CERT Recently Published Vulnerability Notes
T
Tor Project blog
AWS News Blog
AWS News Blog
Simon Willison's Weblog
Simon Willison's Weblog
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
爱范儿
爱范儿
P
Privacy International News Feed
云风的 BLOG
云风的 BLOG
P
Proofpoint News Feed
S
Securelist
G
Google Developers Blog
The Last Watchdog
The Last Watchdog
Google Online Security Blog
Google Online Security Blog
美团技术团队
F
Fortinet All Blogs
小众软件
小众软件
Recorded Future
Recorded Future
V
Visual Studio Blog
B
Blog RSS Feed
H
Help Net Security
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
Google DeepMind News
Google DeepMind News
Blog — PlanetScale
Blog — PlanetScale
博客园 - 聂微东
Stack Overflow Blog
Stack Overflow Blog
Martin Fowler
Martin Fowler
Latest news
Latest news
Spread Privacy
Spread Privacy
H
Heimdal Security Blog

博客园 - onekey

MPU9250九轴陀螺仪--读接口数据 MPU9250九轴陀螺仪--连接MPU9250 centos 7下rabbitmq安装(转) CentOS下Redis的安装(转) CentOS7.5 安装MySQL8 tar Ntrip协议简介(转) 路径规划(3)--搭建Ntrip环境:NtripServer,NtripClient and NtripCaster 路径规划(2)--设置基站和移动站 路径规划(1)--连接GPS接收端 环境搭建--使用pytharm远程调试树莓派 在CentOS 7上安装Nginx elasticsearch -- Logstash实现mysql同步数据到elasticsearch elasticsearch -- 安装 elasticsearch -- kibana安装配置 Elasticsearch -- Head插件安装 在Win10 Anaconda中安装Tensorflow TensorFlow官方文档中文版 myeclipse编译、输出 win7 64位下使用oracle ado.net entity framework
Elasticsearch -- 索引管理
onekey · 2019-03-15 · via 博客园 - onekey

1、#获取当前索引
 # curl -u elastic:changeme 'localhost:9200/_cat/indices?v' 

2、 #删除指定索引
    # curl -XDELETE -u elastic:changeme http://localhost:9200/acc-apply-2018.08.09
    {"acknowledged":true}


 3、#删除多个指定索引,中间用逗号隔开
    # curl -XDELETE -u elastic:changeme http://localhost:9200/acc-apply-2018.08.09,acc-apply-2018.08.10

4、#模糊匹配删除
    # curl -XDELETE -u elastic:changeme http://localhost:9200/acc-apply-*
    {"acknowledged":true}
 

5、#使用通配符,删除所有的索引
     curl -XDELETE http://localhost:9200/_all
     或 curl -XDELETE http://localhost:9200/*
    _all ,* 通配所有的索引
    通常不建议使用通配符,误删了后果就很严重了,所有的index都被删除了
    禁止通配符为了安全起见,可以在elasticsearch.yml配置文件中设置禁用_all和*通配符
    action.destructive_requires_name = true
    这样就不能使用_all和*了

6、如果存储不够可以设置定时删除,下面是保留3天的日志

   curl -XDELETE -u elastic:changeme http://localhost:9200/*-$(date -d '-3days' +'%Y.%m.%d') >/dev/null 2>&1

   定时删除

#!/bin/bash
time=$(date -d '-3days' +'%Y.%m.%d')
curl -XDELETE -u elastic:changeme http://localhost:9200/*-${time}