如何在elasticsearch中查看Logstash打到elasticsearch的数据
# cat syslog02.conf
#filename:syslog02.conf #注意这个是要用#号注释掉
input{
file{
path => ["/var/log/*.log"]
}
}
output{
elasticsearch {
hosts => ["12x.xx.15.1xx:9200"]
}
}
查看配置文件是否有问题:
# ../bin/logstash -f syslog02.conf -t
Sending Logstash's logs to /usr/local/logstash/logs which is now configured via log4j2.properties
[--01T09::,][FATAL][logstash.runner ] The given configuration is invalid. Reason: Expected one of #, input, filter, output at line , column (byte ) after
在output->elasticsearch下增加一个index配置:
cat syslog02.conf
#filename:syslog02.conf
input{
file{
path => ["/var/log/*.log"]
}
}
output{
elasticsearch {
hosts => ["123.57.15.154:9200"]
index => "syslog02_log"
}
}
再次简测配置文件:
# ../bin/logstash -f syslog02.conf -t
Sending Logstash's logs to /usr/local/logstash/logs which is now configured via log4j2.properties
Configuration OK
[--01T11::,][INFO ][logstash.runner ] Using config.test_and_exit mode. Config Validation Result: OK. Exiting Logstash
启动并在后台执行:
# ../bin/logstash -f syslog02.conf &
如何在elasticsearch中查看Logstash打到elasticsearch的数据的更多相关文章
- 如何在Linux中查看所有正在运行的进程
如何在Linux中查看所有正在运行的进程 FROM:http://os.51cto.com/art/201101/244090.htm 进程是一个其中运行着一个或多个线程的地址空间和这些线程所需要的系 ...
- 如何在 Linux 中查看进程占用的端口号【转】
对于 Linux 系统管理员来说,清楚某个服务是否正确地绑定或监听某个端口,是至关重要的.如果你需要处理端口相关的问题,这篇文章可能会对你有用. 端口是 Linux 系统上特定进程之间逻辑连接的标识, ...
- 沉淀再出发:如何在eclipse中查看java的核心代码
沉淀再出发:如何在eclipse中查看java的核心代码 一.前言 很多时候我们在eclipse中按F3键打算查看某一个系统类的定义的时候,总是弹出找不到类这样的界面,这里我们把核心对应的代码加进 ...
- 如何在 Linux 中查看可用的网络接口
在我们安装完一个 Linux 系统后最为常见的任务便是网络配置了.当然,你可以在安装系统时进行网络接口的配置.但是,对于某些人来说,他们更偏爱在安装完系统后再进行网络的配置或者更改现存的设置.众所周知 ...
- 【转】如何在 Linux 中查看可用的网络接口
原文:https://www.cnblogs.com/qianpangzi/p/10563979.html 查看ubuntu系统当前的可用的网络接口.方法如下 -------------------- ...
- 如何在Eclipse中查看Android源码或者第三方组件包源码
文章出处:http://blog.csdn.net/cjjky/article/details/6535426 在学习过程中如果经常阅读源码,理解程度会比较深,学习效率也会比较高,那么如何方便快捷的阅 ...
- (转)如何在Eclipse中查看JDK类库的源代码
在Eclipse中查看JDK类库的源代码!!! 设置: 1.点 “window”-> "Preferences" -> "Java" -> & ...
- 如何在makfile中查看变量的值
在makefile中查看变量的取值是多少应该是一个比较麻烦的问题,但是本大神自己研究出一个十分方便的方法.这个方法十分简单.现在介绍如下 如果在一个十分复杂庞大的makefile文件中,有个地方用到一 ...
- 如何在Eclipse中查看JDK以及JAVA框架的源码(转载)
原文链接:http://www.cnblogs.com/outlooking/p/5243415.html 设置步骤如下: 1.点 “window”-> "Preferences&qu ...
随机推荐
- Laravel5.1-错误和日志
简介 这一章也是属于文档写得比较混乱的一章,所以我决定重新组织一下内容结构: 配置 debug配置 我们都知道,开发环境应该把debug打开,生产环境应该把debug关闭:这个设置在config/ap ...
- java代码和spring框架读取xml和properties文件
1.java文件读取properties文件 Properties props = new Properties(); try { //资源文件存放在类文件的根目录下.即是放在src下面.则不需要写路 ...
- Android实用代码模块集锦
1. 精确获取屏幕尺寸(例如:3.5.4.0.5.0寸屏幕) 1 2 3 4 5 6 public static double getScreenPhysicalSize(Activity ctx) ...
- 2.6---找有环链表的开头结点(CC150)
public ListNode detectCycle(ListNode head) { ListNode fast = head; ListNode slow = head; int flag = ...
- Quartz表达式详解(转载)
1. CronTrigger时间格式配置说明 CronTrigger配置格式: 格式: [秒] [分] [小时] [日] [月] [周] [年] 序号 说明 是否必填 允许填写的值 允许的通配符 ...
- bootstrap按钮组
种类 -a, input , button 块级 btn-block 按钮组 btn-group btn-group-justified btn-group-vertical </div ...
- ubuntu set ntpdate
1. 安装ntpdate工具 # sudo apt-get install ntpdate 2. 设置系统时间与网络时间同步 # ntpdate cn.pool.ntp.org 3. 将系统时间 ...
- 图解SSL/TLS协议(HTTPS的安全层)
http://blog.csdn.net/wallezhe/article/details/50977337 图解SSL/TLS协议 作者: 阮一峰 日期: 2014年9月20日 本周,Clo ...
- Random Pick Index
Given an array of integers with possible duplicates, randomly output the index of a given target num ...
- (转)关于Certificate、Provisioning Profile、App ID的介绍及其之间的关系
转自http://www.cnblogs.com/cywin888/p/3263027.html 刚接触iOS开发的人难免会对苹果的各种证书.配置文件等不甚了解,可能你按照网上的教程一步一步的成功申请 ...