input {
file {
path => ["/data/test.log"]
start_position => "beginning"
sincedb_path => "/dev/null"
}
}
output {
stdout {
codec => rubydebug
}
}

要点就在这行 sincedb_path => “/dev/null” 了!该参数用来指定 sincedb 文件名,但是如果我们设置为 /dev/null这个 Linux 系统上特殊的空洞文件,那么 logstash 每次重启进程的时候,尝试读取 sincedb 内容,都只会读到空白内容,也就会理解成之前没有过运行记录,自然就从初始位置开始读取了!

ES报错Result window is too large问题处理:

我在使用Elasticsearch进行search查询的过程中,出现了Result window is too large问题。
这里简单做一个报错复现:

In [1]: import requests

In [2]: requests.get('http://127.0.0.1:9200/cmdb-now/_search?page=1&size=10000000').json()
Out[2]:
{u'error': {u'failed_shards': [{u'index': u'cmdb-now',
u'node': u'ldeZMZRAR6uZpAiIr5QxBQ',
u'reason': {u'reason': u'Result window is too large, from + size must be less than or equal to: [10000] but was [10000000]. See the scroll api for a more efficient way to request large data sets. This limit can be set by changing the [index.max_result_window] index level parameter.',
u'type': u'query_phase_execution_exception'},
u'shard': 0}],
u'grouped': True,
u'phase': u'query',
u'reason': u'all shards failed',
u'root_cause': [{u'reason': u'Result window is too large, from + size must be less than or equal to: [10000] but was [10000000]. See the scroll api for a more efficient way to request large data sets. This limit can be set by changing the [index.max_result_window] index level parameter.',
u'type': u'query_phase_execution_exception'}],
u'type': u'search_phase_execution_exception'},
u'status': 500}

从上面的报错信息,可以看到ES提示我结果窗口太大了,目前最大值为10000,而我却要求给我10000000。并且在后面也提到了要求我修改index.max_result_window参数来增大结果窗口大小。
我google了修改方法,命令如下:

curl -XPUT http://10.75.8.167:9200/logstash-sql-2017.*/_settings -d '{ "index" : { "max_result_window" : 100000000}}'

												

让Logstash每次都从头读文件及常见问题的更多相关文章

  1. 多个 gradle 文件夹 \.gradle\wrapper\dists\ 设置gradle不是每次都下载

    韩梦飞沙  韩亚飞  313134555@qq.com  yue31313  han_meng_fei_sha 设置gradle不是每次都下载 \.gradle\wrapper\dists\ ==== ...

  2. Linux基础: 一切都是文件

    ​ 一切都是文件 创建系统配置交换分区(用作虚拟内存)加上单根树 file 文件名 查看文件类型 uname 查看系统版本 bin binary二进制文件 所有用户可用 系统可执行命令的二进制文件(c ...

  3. Git push 时每次都需要密码的疑惑

    2015.1.13更新: 在本地搭建Git服务器时,也是有每次操作需要密码的情况. 是因为每次做推送动作时,Git需要认证你是好人.所以需要密码. 可以在 /home/username/.ssh/au ...

  4. 使用git提交到github,每次都要输入用户名和密码的解决方法

    使用git提交文件到github,每次都要输入用户名和密码,操作起来很麻烦,以下方法可解决,记录以下. 原因:在clone 项目的时候,使用了 https方式,而不是ssh方式. 默认clone 方式 ...

  5. 使用git提交代码到github,每次都要输入用户名和密码的解决方法

    自从使用git提交代码到github后,发现自己使用git的功力增长了不少,但也遇到不少问题.比如,使用git提交代码到github的时候,经常要求输入用户名和密码,类似这种: 网上有这么一种解决方法 ...

  6. Jupyter Notebook启动不会自动打开浏览器,每次都要自己打开浏览器输入网址

    今天在使用jupyter 时,已启动服务,但每次都需要手动去浏览器 输入网址才可以, 最好找了好久才解决了. 去cmd 命令窗口执行jupyter notebook --generate-config ...

  7. 【转载】win10解决设置默认打开方式不生效问题(双击每次都要选择默认打开程序)

    win10解决设置默认打开方式不生效问题(双击每次都要选择默认打开程序) 以下文章 部分选自 https://blog.csdn.net/shan165310175/article/details/8 ...

  8. (亲测解决)每次打开excel文件都会出现两个窗口,一个是空白的sheet1,另一个是自己的文档

    版权声明:本文为博主原创文章,转载请注明出处! https://blog.csdn.net/sinat_34104446/article/details/80210424 一.问题描述每次打开Exce ...

  9. linux cp覆盖每次都有提示

    1.cp命令,目标已经存在,每次都提示是否覆盖,怎么办? 2.cp --help 可以看到选项-i的时候,才会提示,但是这里并没有-i,为什么每次都有提示? 3.原因是:这里执行的cp是一个别名,通过 ...

随机推荐

  1. Matlab 三维绘图与统计绘图

    一. 三维绘图 p = : pi/: *pi; x = cos(p); y = sin(p); z = p; plot3(x,y,z) x = -:.:; %有-2为起点,2为递增步长,2为终止点 y ...

  2. SqlServer 连接远程服务器数据库 实现跨服务器联合查询

    第一种: exec sp_addlinkedserver 'ITSV ', ' ', 'SQLOLEDB ', '远程服务器名或ip地址 ' exec sp_addlinkedsrvlogin 'IT ...

  3. 泛型实体类List<>绑定到repeater

    后台代码: private void bindnewslist() { long num = 100L; List<Model.news> news = _news.GetList(out ...

  4. Python tkinter 控件更新信息

    下面几个例子关于tkinter界面更新的,简单易懂,分享一下. 例子_1: 代码_1: from tkinter import Tk, Checkbutton, Label from tkinter ...

  5. LeetCode 41 First Missing Positive(找到数组中第一个丢失的正数)

    题目链接: https://leetcode.com/problems/first-missing-positive/?tab=Description   给出一个未排序的数组,求出第一个丢失的正数. ...

  6. [转]redhat7(centos7) not registered to Red Hat Subscription Management

    [root@controller0 ~]# yum install ntp Loaded plugins: fastestmirror, product-id, search-disabled-rep ...

  7. php底层变量分析

    <?php //数组引用 $arr = array('a','b','c','d'); $x = & $arr[1]; $tmp = $arr; $arr[1] = 'e'; echo ...

  8. Unity3D Shader描边效果

    Shader "Custom/RimColor" { Properties { _MainTex ("Base (RGB)", 2D) = "whit ...

  9. matlab中画系统零极点的方法

    写论文的时候由于需要画出系统的零极点图.但是之前不知道怎么用matlab画,今天研究了一下,拿出来和大家共享.所用到的matlab函数为zplane,matlab给出的解释如下: ZPLANE Z-p ...

  10. Amazon ec2 改成密码登录方式

    sudo passwd rootsu rootvi /etc/ssh/sshd_config"# PasswordAuthentication yes" uncommentsbin ...