精华内容
下载资源
问答
  • logstash启动脚本

    2017-08-31 09:00:34
    logstash启动脚本
  • logstash-启动

    万次阅读 2019-08-26 13:27:32
    logstash依赖于JDK,所以需要先安装JAVA_HOME环境变量 安装路径需要注意,不能含有冒号(:)

    本次使用的是logstash-6.8.1版本

    logstash依赖于JDK,所以需要先安装JAVA_HOME环境变量

    安装路径需要注意,不能含有冒号(:)

    官网文档:https://www.elastic.co/guide/en/logstash/6.8/first-event.html
    windows启动:https://www.elastic.co/guide/en/logstash/6.8/running-logstash-windows.html
    windows下安装:
    直接解压,就是安装成功

    关于启动logstash:
    logstash启动需要有配置文件,在此安装目录中config中已经有了配置,logstash-sample.conf
    配置如下:

    # Sample Logstash configuration for creating a simple
    # Beats -> Logstash -> Elasticsearch pipeline.
    
    input {
      beats {
        port => 5044
      }
    }
    
    output {
      elasticsearch {
        hosts => ["http://localhost:9200"]
        index => "%{[@metadata][beat]}-%{[@metadata][version]}-%{+YYYY.MM.dd}"
        #user => "elastic"
        #password => "changeme"
      }
    }
    

    logstash默认是安装beats的(端口5044),output中可以看出需要启动elasticsearch(可以设置用户名密码)

    因此启动测试配置试一下:logstash -f …/config/logstash-sample.conf --config.test_and_exit
    结果:
    在这里插入图片描述
    启动命令:logstash -f …/config/logstash-sample.conf
    logstash日志窗口:
    在这里插入图片描述
    elasticsearch 日志窗口:
    在这里插入图片描述
    访问地址:http://localhost:9600/
    打印如下:
    {“host”:“DESKTOP-wl”,“version”:“6.8.1”,“http_address”:“127.0.0.1:9600”,“id”:“430d33d7-99cd-4a36-b403-e0efadb30615”,“name”:“DESKTOP-wl”,“build_date”:“2019-06-18T14:11:07+00:00”,“build_sha”:“e99c3a5386ec3b64789dc003fc99e0a86ede0f0f”,“build_snapshot”:false}
    说明启动成功

    logstash -f ../config/logstash-sample.conf --config.reload.automatic
    

    该–config.reload.automatic选项启用自动配置重新加载,因此您不必在每次修改配置文件时停止并重新启动Logstash。

    报错:

    • 1.无法加载到主类*****animal-sniffer-annotations-1.14.jar
      解决办法,就是将windows下的安装包复制到没有空格的安装路径下,logstash会对有空格的路径报错
    • 2.An exceptionCaught() event was fired, and it reached at the tail of the pipeline. It usually means the last handler in the pipeline did not handle the exception
    [io.netty.channel.DefaultChannelPipeline] An exceptionCaught() event was fired, and it reached at the tail of the pipeline. It usually means the last handler in the pipeline did not handle the exception.
    io.netty.handler.codec.DecoderException: org.logstash.beats.BeatsParser$InvalidFrameProtocolException: Invalid Frame Type, received: 84
            at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:472) ~[netty-all-4.1.30.Final.jar:4.1.30.Final]
            at io.netty.handler.codec.ByteToMessageDecoder.channelInputClosed(ByteToMessageDecoder.java:405) ~[netty-all-4.1.30.Final.jar:4.1.30.Final]
            at io.netty.handler.codec.ByteToMessageDecoder.channelInputClosed(ByteToMessageDecoder.java:372) ~[netty-all-4.1.30.Final.jar:4.1.30.Final]
            at io.netty.handler.codec.ByteToMessageDecoder.channelInactive(ByteToMessageDecoder.java:355) ~[netty-all-4.1.30.Final.jar:4.1.30.Final]
            at io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:245) ~[netty-all-4.1.30.Final.jar:4.1.30.Final]
            at io.netty.channel.AbstractChannelHandlerContext.access$300(AbstractChannelHandlerContext.java:38) ~[netty-all-4.1.30.Final.jar:4.1.30.Final]
            at io.netty.channel.AbstractChannelHandlerContext$4.run(AbstractChannelHandlerContext.java:236) ~[netty-all-4.1.30.Final.jar:4.1.30.Final]
            at io.netty.util.concurrent.DefaultEventExecutor.run(DefaultEventExecutor.java:66) ~[netty-all-4.1.30.Final.jar:4.1.30.Final]
            at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:897) [netty-all-4.1.30.Final.jar:4.1.30.Final]
            at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) [netty-all-4.1.30.Final.jar:4.1.30.Final]
            at java.lang.Thread.run(Thread.java:748) [?:1.8.0_192]
    Caused by: org.logstash.beats.BeatsParser$InvalidFrameProtocolException: Invalid Frame Type, received: 84
            at org.logstash.beats.BeatsParser.decode(BeatsParser.java:92) ~[logstash-input-beats-5.1.8.jar:?]
            at io.netty.handler.codec.ByteToMessageDecoder.decodeRemovalReentryProtection(ByteToMessageDecoder.java:502) ~[netty-all-4.1.30.Final.jar:4.1.30.Final]
            at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:441) ~[netty-all-4.1.30.Final.jar:4.1.30.Final]
            ... 10 more
    
    展开全文
  • logstash

    问题1:The following config files contains non-ascii characters but are not UTF-8 encoded

    [ERROR][logstash.config.sourceloader] Could not fetch all the sources {:exception=>LogStash::ConfigLoadingError, :message=>"The following config files contains non-ascii characters but are not UTF-8 encoded [\"d:/ELK/logstash-6.2.2/config/logstash-pg-es.conf\"]", :backtrace=>["D:/ELK/logstash-6.2.2/logstash-core/lib/logstash/config/source/local.rb:85:in `read'", "D:/ELK/logstash-6.2.2/logstash-core/lib/logstash/config/source/local.rb:96:in `read'", "D:/ELK/logstash-6.2.2/logstash-core/lib/logstash/config/source/local.rb:192:in `local_pipeline_configs'", "D:/ELK/logstash-6.2.2/logstash-core/lib/logstash/config/source/local.rb:163:in `pipeline_configs'", "D:/ELK/logstash-6.2.2/logstash-core/lib/logstash/config/source_loader.rb:59:in `block in fetch'", "org/jruby/RubyArray.java:2481:in `collect'", "D:/ELK/logstash-6.2.2/logstash-core/lib/logstash/config/source_loader.rb:58:in `fetch'", "D:/ELK/logstash-6.2.2/logstash-core/lib/logstash/agent.rb:148:in `converge_state_and_update'", "D:/ELK/logstash-6.2.2/logstash-core/lib/logstash/agent.rb:90:in `execute'", "D:/ELK/logstash-6.2.2/logstash-core/lib/logstash/runner.rb:348:in `block in execute'", "D:/ELK/logstash-6.2.2/vendor/bundle/jruby/2.3.0/gems/stud-0.0.23/lib/stud/task.rb:24:in `block in initialize'"]}
    

    解决:将文件转为UTF-8 编码

    问题2:Expected one of #, input, filter, output at line 1, column 1 (byte 1) after

     Failed to execute action {:action=>LogStash::PipelineAction::Create/pipeline_id:main, :exception=>"LogStash::ConfigurationError", :message=>"Expected one of #, input, filter, output at line 1, column 1 (byte 1) after ", :backtrace=>["D:/ELK/logstash-6.2.2/logstash-core/lib/logstash/compiler.rb:42:in `compile_imperative'", "D:/ELK/logstash-6.2.2/logstash-core/lib/logstash/compiler.rb:50:in `compile_graph'", "D:/ELK/logstash-6.2.2/logstash-core/lib/logstash/compiler.rb:12:in `block in compile_sources'", "org/jruby/RubyArray.java:2486:in `map'", "D:/ELK/logstash-6.2.2/logstash-core/lib/logstash/compiler.rb:11:in `compile_sources'", "D:/ELK/logstash-6.2.2/logstash-core/lib/logstash/pipeline.rb:51:in `initialize'", "D:/ELK/logstash-6.2.2/logstash-core/lib/logstash/pipeline.rb:169:in `initialize'", "D:/ELK/logstash-6.2.2/logstash-core/lib/logstash/pipeline_action/create.rb:40:in `execute'", "D:/ELK/logstash-6.2.2/logstash-core/lib/logstash/agent.rb:315:in `block in converge_state'", "D:/ELK/logstash-6.2.2/logstash-core/lib/logstash/agent.rb:141:in `with_pipelines'", "D:/ELK/logstash-6.2.2/logstash-core/lib/logstash/agent.rb:312:in `block in converge_state'", "org/jruby/RubyArray.java:1734:in `each'", "D:/ELK/logstash-6.2.2/logstash-core/lib/logstash/agent.rb:299:in `converge_state'", "D:/ELK/logstash-6.2.2/logstash-core/lib/logstash/agent.rb:166:in `block in converge_state_and_update'", "D:/ELK/logstash-6.2.2/logstash-core/lib/logstash/agent.rb:141:in `with_pipelines'", "D:/ELK/logstash-6.2.2/logstash-core/lib/logstash/agent.rb:164:in `converge_state_and_update'", "D:/ELK/logstash-6.2.2/logstash-core/lib/logstash/agent.rb:90:in `execute'", "D:/ELK/logstash-6.2.2/logstash-core/lib/logstash/runner.rb:348:in `block in execute'", "D:/ELK/logstash-6.2.2/vendor/bundle/jruby/2.3.0/gems/stud-0.0.23/lib/stud/task.rb:24:in `block in initialize'"]}
    

    解决:
    1.删除配置文件中的注释内容
    2.查看文件缩进是否有问题
    3.将文件转为utf-8无bom编码格式

    展开全文
  • logstash linux 安装使用

    2020-12-22 12:19:07
    logstash 教程:http://kibana.logstash.es/content/logstash/get_start/full_config.htmlhttps://wsgzao.github.io/post/elk/es配置教程:http://ju.outofmemory.cn/entry/214901一、安装OpenJDKyum install java-...

    logstash 教程:http://kibana.logstash.es/content/logstash/get_start/full_config.html

    https://wsgzao.github.io/post/elk/

    es配置教程:http://ju.outofmemory.cn/entry/214901

    一、安装OpenJDK

    yum install java-1.7.0-openjdk

    二、安装Elaticsearch

    1、下载ES

    cd /tmp

    wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.4.4.tar.gz

    tar zxvf elasticsearch-1.4.4.tar.gz

    mv elasticsearch-1.4.4 /home/elasticsearch

    2、安装启动脚本

    cd /tmp

    git clone https://github.com/elasticsearch/elasticsearch-servicewrapper.git

    cd /tmp/elasticsearch-servicewrapper

    mv service /home/elasticsearch/bin/

    cd /tmp

    rm -rf elasticsearch-servicewrapper

    cd /home/elasticsearch/bin/service

    vim elasticsearch.conf

    编辑elasticsearch.conf(即:1 && 2 行),设置为/home/elasticsearch,修改ES_HEAP_SIZE (内存的60%)(单位是M)

    ./elasticsearch install

    3、打开防火墙9200

    vim /etc/sysconfig/iptables

    添加一行:

    -A INPUT -m state --state NEW -m tcp -p tcp --dport 9200 -j ACCEPT

    4、安装插件(可选)

    cd /home/elasticsearch/

    bin/plugin -install mobz/elasticsearch-head

    bin/plugin -install lmenezes/elasticsearch-kopf

    更多请参照:http://www.elastic.co/guide/en/elasticsearch/reference/1.3/modules-plugins.html

    5、启动es

    /etc/init.d/elasticsearch restart

    6、测试(xxx.xxx.xxx.xxx是服务期IP地址)

    可以访问:xxx.xxx.xxx.xxx:9200 ,看状态是否是:200

    或者访问插件kopf:xxx.xxx.xxx.xxx:9200/_plugin/kopf

    三、安装Logstash

    1、安装 (已有更新版,请去官网查看)

    cd /home

    wget -O /home/logstash-1.4.2.tar.gz https://download.elasticsearch.org/logstash/logstash/logstash-1.4.2.tar.gz

    tar zxvf logstash-1.4.2.tar.gz

    rm -rf logstash-1.4.2.tar.gz

    mv logstash-1.4.2 logstash

    mkdir /etc/logstash

    mkdir /var/log/logstash

    2、创建配置文件:(这个路径与下面步骤的启动脚本里是对应的)

    vim /etc/logstash/index.conf

    添加如下内容:

    input {

    file {

    path => "/var/log/messages"

    start_position => "beginning"

    codec => plain {

    charset => "GBK" }

    type => "file"

    }

    }

    output {

    elasticsearch {

    host => "127.0.0.1"

    }

    }

    补充:

    更多功能:http://logstash.net/docs/1.4.2/

    3、插件

    cd /home/logstash

    bin/plugin install contrib

    4、启动文件

    wget -O /etc/init.d/logstash http://update.biglog.org/logstash

    chmod +x /etc/init.d/logstash

    chkconfig --add logstash

    chkconfig logstash on

    service logstash start

    四、安装Kibana

    1、安装

    cd /home

    wget https://download.elasticsearch.org/kibana/kibana/kibana-4.0.1-linux-x64.tar.gz

    tar zxvf kibana-4.0.1-linux-x64.tar.gz

    rm -fr kibana-4.0.1-linux-x64.tar.gz

    mv kibana-4.0.1-linux-x64 kibana

    2、配置

    cd /home/kibana

    vim config/kibana.yml

    根据需要修改:

    ---kibana端口号,默认是5601

    ---kibana的索引名称,默认是:.kibana

    ---es的url,默认是:http://localhost:9200

    3、打开防火墙

    打开kibana对应的端口号,方法同上面

    4、启动

    cd /home/kibana

    bin/kibana

    5、测试

    然后浏览器访问:xxx.xxx.xxx.xxx:5601,进行配置即可

    展开全文
  • logstash启动报错 [root@localhost ~]# systemctl start logstash Failed to start logstash.service: Unit not found. 解决方法 [root@localhost ~]# rpm -qa |grep logstash logstash-7.3.2-1.noarch [root@...

    logstash启动报错

    [root@localhost ~]# systemctl start logstash
    Failed to start logstash.service: Unit not found.
    

    解决方法

    [root@localhost ~]# rpm -qa |grep logstash
    logstash-7.3.2-1.noarch
    
    [root@localhost ~]# rpm -qa |grep logstash|xargs yum -y remove #卸载
    
    [root@localhost ~]# rpm -ivh logstash-7.3.2.rpm #安装logstash
    
    
    展开全文
  • logstash 启动命令

    2021-11-04 14:25:58
    ./logstash -f /etc/logstash/config.d/xxx.conf & 配置数据存储路径 参考: https://blog.csdn.net/sxf_123456/article/details/78863949 2. pipelines 启动 pipelines 实现批量运行,配置之后不用一个一个...
  • logstash 运行

    千次阅读 2020-12-22 12:19:05
    logstash linux下启动如下(守护进程)./bin/logstash agent -f conf/paycenter.conf &logstash配置测试服务器的写法:业务日志文件格式如果是按天分隔:gwp.eyimi....
  • logstash服务启动脚本

    2021-05-14 12:11:53
    vi /etc/init.d/logstash#!/bin/sh# Init scriptforlogstash# Maintained by Elasticsearch# Generated by pleaserun.# Implemented based on LSB Core3.1:#* Sections: 20.2, 20.3#### BEGIN INIT INFO# Provides: ...
  • logstash启动方式

    2021-11-19 18:36:07
    logstash启动手动启动运行后台启动部署成服务启动 手动启动运行 /aaa/aaa/logstash/bin/logstash -f /aaa/aaa/logstash/config/aaa.conf == 中途强制停止后再次启动出现问题,需要到data目录下执行 ls -alh 命令...
  • crontab logstash 定时检测及服务启动 解决logstash服务频繁宕机
  • logstash无法启动解决方案

    千次阅读 2019-02-13 18:11:34
    使用yum install安装完logstash后,执行systemctl status logstash.service无法启动 报错如下: could not find java; set JAVA_HOME or ensure java is in PATH 其实该服务器的java环境以及配合好了,但是启动...
  • Cenots6.8 Logstash 后台启动

    万次阅读 2018-12-24 10:35:51
    vim /opt/elogstash/logstash-6.5.1/startup.sh nohup bin/logstash -f config/kafka.conf & ./startup.sh 即可后台启动 tail -f nohup.out 可查看启动日志
  • logstash 对于初学者来说是最容易出问题的,所以一下要开 2 个 SSH,一个是命令操作,一个用 看查看日志,要保证不要报错。 1、安装 我们已经配置过Elasticsearch的yum源,这里可以直接使用。 # dnf -y install --...
  • logstash启动命令及参数

    千次阅读 2020-09-02 17:52:04
    启动参数及命令 转载别人的,点它查看
  • 最新在研究elastic stack (elk) : logstash 安装,下载最新版本的logstash:...解压到磁盘根目录下:在logstash>bin 1、目录下创建:logstash.conf 2、输入内容: input { stdin{ }} output { stdout{ }}3、 o...
  • ***elk安装需要2g内存*** 1、logstash下载:https://www.elastic.co/cn/downloads/past-releases/ ...3、进入/usr/local/logstash-6.3.1/config/ 4、在/usr/local/logstash-6.3.1/config目录下新增一个文件 ...
  • windows下logstash启动情况

    千次阅读 2020-02-20 23:04:17
    1. 首先下载匹配elasticsearch的logstash 2. 解压logstash 3. 在logstash/bin文件夹下创建logstash.conf input{ stdin{} } output{ stdout{} } 4. 在logstash/bin目录下,运行logstash -f logstash.conf 5. ...
  • # 后台启动 nohup ./logstash -f ../config/myes.conf & # 查看日志 tail -f nohup.out
  • ELK中的logstash启动后无输出

    万次阅读 2017-09-18 16:33:26
    我这里用的版本分别是elasticsearch-2.3.0、logstash-2.3.0、kibana-4.5.0;和书中的版本不同,在373页我按照书上的例子取一条典型的nxlog日志,保存文件名为nxlog_access.log,编写配置文件,文件名为logstash_nxlog...
  • 一次logstash 启动,linux分析解决问题
  • logstash入门篇之安装启动 本文包含内容如下: logstash简介、下载和安装、 启动和后台启动、 运行原理、 自动装载配置文件
  • logstash部署到服务器后台启动命令

    千次阅读 2019-12-12 11:56:53
    logstash部署到服务器后台启动命令 在logstash安装目录下(logstash和elasticsearch版本一致) 进入 /data/mallreport/elasticsearch/logstash-6.8.2/bin 目录 2.输入 nohup ./logstash -f …\mysql\mysql-local....
  • 基本的键盘输入并打印测试,一般用来测试logstash是否可用 .\bin\logstash.bat -e "input { stdin { } } output { stdout {} }" 配置: 配置.conf文件,一般包含字段为,stdin,filter,stdout,样例如下: ...
  • logstash 安装与启动

    2018-03-14 16:32:00
    2019独角兽企业重金招聘Python工程师标准>>> ...启动 nohup ./bin/logstash -f logstash.config &>nohup.log&   转载于:https://my.oschina.net/u/136848/blog/1634685
  • Logstash: 启动监控及集中管理

    千次阅读 热门讨论 2019-12-31 10:48:53
    在本篇文章里,我将详细介绍如果启动Logstash的监控及集中管理。 前提条件 如果你还没安装好自己的Logstash,请参照文章“如何安装Elastic栈中的Logstash”。同时安装我之前的文章“Elasticsearch:设置Elastic...
  • Logstash 启动报错

    千次阅读 2019-09-13 16:40:33
    使用journalctl -xe | grep logstash 命令查看日志如下 Sep 13 16:37:23 am02 logstash[298460]: could not find java; set JAVA_HOME or ensure java is in PATH Sep 13 16:37:23 am02 systemd[1]: logstash....

空空如也

空空如也

1 2 3 4 5 ... 20
收藏数 21,711
精华内容 8,684
关键字:

查看logstash是否启动