当前位置: 首页 > 知识库问答 >
问题:

Logstash只给了我两块木头

越学博
2023-03-14

使用里程碑2输入插件文件。这个插件应该是稳定的,但是如果你看到奇怪的行为,请让我们知道!有关插件的详细信息,请参阅http://logstash.net/docs/1.4.2/plugin-milestones{: level=

我的配置:

input {
file {
path => [ "e:\mycsvfile.csv" ]
start_position => "beginning"
}
}
filter {
csv {
columns => ["col1","col2"]
source => "csv_data"
separator => ","
}
}

output {
elasticsearch { 
host => localhost
port => 9200
index => test
index_type => test_type
protocol => http
}
stdout { 
codec => rubydebug
}
}

我的环境:Windows 8 logstash 1.4.2

问:以前有人经历过这种情况吗?日志存放在哪里?windows上是否存在已知的日志存储错误?根据我的经验,logstash什么也做不了。

我试过:

logstash.bat agent -f test.conf --verbose
←[33mUsing milestone 2 input plugin 'file'. This plugin should be stable, but if
you see strange behavior, please let us know! For more information on plugin mi
lestones, see http://logstash.net/docs/1.4.2/plugin-milestones {:level=>:warn}←[
0m
←[33mUsing milestone 2 filter plugin 'csv'. This plugin should be stable, but if
you see strange behavior, please let us know! For more information on plugin mi
lestones, see http://logstash.net/docs/1.4.2/plugin-milestones {:level=>:warn}←[
0m
←[32mRegistering file input {:path=>["e:/temp.csv"], :level=>:info}←[0m
←[32mNo sincedb_path set, generating one based on the file path {:sincedb_path=>
"C:\Users\gemini/.sincedb_d8e46c18292a898ea0b5b1cd94987f21", :path=>["e:/tem
p.csv"], :level=>:info}←[0m
←[32mPipeline started {:level=>:info}←[0m
←[32mNew Elasticsearch output {:cluster=>nil, :host=>"localhost", :port=>9200, :
embedded=>false, :protocol=>"http", :level=>:info}←[0m
←[32mAutomatic template management enabled {:manage_template=>"true", :level=>:i
nfo}←[0m
←[32mUsing mapping template {:template=>"{ \"template\" : \"logstash-\", \"se
ttings\" : { \"index.refresh_interval\" : \"5s\" }, \"mappings\" : { \"_
default_\" : { \"_all\" : {\"enabled\" : true}, \"dynamic_templates\
" : [ { \"string_fields\" : { \"match\" : \"\", \"m
atch_mapping_type\" : \"string\", \"mapping\" : { \"type\"
: \"string\", \"index\" : \"analyzed\", \"omit_norms\" : true, \"
fields\" : { \"raw\" : {\"type\": \"string\", \"index\" : \"not_
analyzed\", \"ignore_above\" : 256} } } }
} ], \"properties\" : { \"@version\": { \"type\": \"string\", \"in
dex\": \"not_analyzed\" }, \"geoip\" : { \"type\" : \"object\
", \"dynamic\": true, \"path\": \"full\", \"
properties\" : { \"location\" : { \"type\" : \"geo_point\" }
} } } } }}", :level=>:info}←[0m

这种情况会持续一段时间,elasticsearch中不会创建新索引。

共有2个答案

钱照
2023-03-14

使用CSV作为输入数据时,我必须添加:

sincedb_path=

示例:

input {
file {
    path => [ "C:/csvfilename.txt"]
    start_position => "beginning"
    sincedb_path => "NIL"
}

}

它适用于logstash版本1.4.2

贺宝
2023-03-14

我不得不补充:

sincedb_path => "NIL"

它成功了。

http://logstash.net/docs/1.1.0/inputs/file#setting_sincedb_path

因为CEDB_路径值类型为字符串,所以此设置没有默认值。在何处写入自数据库(跟踪受监视日志文件的当前位置)。默认为环境变量“$SINCEDB_PATH”或“$HOME/.SINCEDB”的值。

在我的C:\users{user}中生成了几个sincedb文件。

 类似资料:
  • 我阅读下面的文章,以了解我建立的ELK环境的日志技术。https://tpodolak.com/blog/tag/kibana/ 我在日志中添加了输入路径 C/日志/*.log。我有测试.log文件,它不为空,它有: 我的日志(C:\监控\logstash\日志\C:\监控\logstash\logs.log):

  • 当我在其上传递一个帐户时,我的if会运行两次 所以是正确的: 因此它执行两次: 如何使用-400只运行一次?

  • 我想使用进行AppIndexing。我应该使用,但当我在Android Studio中打印出时,我只有SHA1。 最大的问题是,为什么Android Studio只在我从Gradle打印时列出调试键,为什么它说?知道吗? 顺便说一句,这个问题和建议的副本没有关系。 回答jyomin 2的问题。我希望它也能帮助别人。 null 小心!!! 如果您在密钥库中有多个密钥,它可能不会为您提供与给定应用程序

  • 作者:July、caopengcs、红色标记。致谢:fuwutu、demo。 时间:二零一三年八月十二日 题目:用 1×1×1, 1×2×1以及2×1×1的三种木块(横绿竖蓝,且绿蓝长度均为2), 搭建高长宽分别为K × 2^N × 1的墙,不能翻转、旋转(其中,0<=N<=1024,1<=K<=4) 有多少种方案,输出结果 对1000000007取模。 举个例子如给定高度和长度:N=1 K=2,

  • 我试图让我的discord bot mass给我服务器中的每个人一个角色。每当我做时,它只给我角色。我尝试过使用map和array。使用

  • 我在Cplex中使用Python API来解决一个线性编程问题。使用Cplex时,我的结果如下: 但随后我将LP prolem保存为LP文件,并再次使用Cplex进行求解,结果与第一个略有不同: 下面是我的功能: