- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
看起来像一个简单的用例,但由于某种原因我就是不知道如何做到这一点,或者谷歌一个清晰的例子。
假设我有一条消息存储在logstash中消息:
"info: 2015-11-28 22:02:19,232:common:INFO:ENV: Production User:None:Username:None:LOG: publishing to bus "
我想在 kibana(版本 4)中搜索短语:“发布到总线”我会得到一组结果但如果我搜索:“无:日志:发布到总线”然后我得到“未找到结果”。
显然这个短语确实存在并且是由之前的搜索返回的。
所以我的问题基本上是 - 发生了什么事?搜索可能的长短语的正确方法是什么以及为什么第二个示例失败。
编辑:存储的 JSON。
{
"_index": "logz-ngdxrkmolklnvngumaitximbohqwbocg-151206_v1",
"_type": "django_logger",
"_id": "AVF2DPxZZst_8_8_m-se",
"_score": null,
"_source": {
"log": " publishing to bus {'user_id': 8866, 'event_id': 'aibRBPcLxcAzsEVRtFZVU5', 'timestamp': 1449384441, 'quotes': {}, 'rates': {u'EURUSD': Decimal('1.061025'), u'GBPUSD': Decimal('1.494125'), u'EURGBP': Decimal('0.710150')}, 'event': 'AccountInstrumentsUpdated', 'minute': 1449384420}",
"logger": "common",
"log_level": "INFO",
"message": "2015-12-06 06:47:21,298:common:INFO:ENV: Production User:None:Username:None:LOG: publishing to bus {'user_id': 8866, 'event_id': 'aibRBPcLxcAzsEVRtFZVU5', 'timestamp': 1449384441, 'quotes': {}, 'rates': {u'EURUSD': Decimal('1.061025'), u'GBPUSD': Decimal('1.494125'), u'EURGBP': Decimal('0.710150')}, 'event': 'AccountInstrumentsUpdated', 'minute': 1449384420}",
"type": "django_logger",
"tags": [
"celery"
],
"path": "//path/to/logs/out.log",
"environment": "Staging",
"@timestamp": "2015-12-06T06:47:21.298+00:00",
"user_id": "None",
"host": "path.to.host",
"timestamp": "2015-12-06 06:47:21,298",
"username": "None"
},
"fields": {
"@timestamp": [
1449384441298
]
},
"highlight": {
"message": [
"2015-12-06 06:47:21,298:common:INFO:ENV: Staging User:None:Username:None:LOG: @kibana-highlighted-field@publishing@/kibana-highlighted-field@ @kibana-highlighted-field@to@/kibana-highlighted-field@ @kibana-highlighted-field@bus@/kibana-highlighted-field@ {'user_id': **, 'event_id': 'aibRBPcLxcAzsEVRtFZVU5', 'timestamp': 1449384441, 'quotes': {}, 'rates': {u'EURUSD': Decimal('1.061025'), u'GBPUSD': Decimal('1.494125'), u'EURGBP': Decimal('0.710150')}, 'event': 'AccountInstrumentsUpdated', 'minute': 1449384420}"
]
},
"sort": [
1449384441298
]
}
最佳答案
根据Elasticsearch,它默认使用标准分析器。标准分析器将消息字段标记如下:
"2015-12-06 06:47:21,298:common:INFO:ENV: Production User:None:Username:None:LOG: publishing to bus {'user_id': 8866, 'event_id': 'aibRBPcLxcAzsEVRtFZVU5', 'timestamp': 1449384441, 'quotes': {}, 'rates': {u'EURUSD': Decimal('1.061025'), u'GBPUSD': Decimal('1.494125'), u'EURGBP': Decimal('0.710150')}, 'event': 'AccountInstrumentsUpdated', 'minute': 1449384420}"
{
"tokens": [
{
"token": "2015",
"start_offset": 0,
"end_offset": 4,
"type": "<NUM>",
"position": 0
},
{
"token": "12",
"start_offset": 5,
"end_offset": 7,
"type": "<NUM>",
"position": 1
},
{
"token": "06",
"start_offset": 8,
"end_offset": 10,
"type": "<NUM>",
"position": 2
},
{
"token": "06",
"start_offset": 11,
"end_offset": 13,
"type": "<NUM>",
"position": 3
},
{
"token": "47",
"start_offset": 14,
"end_offset": 16,
"type": "<NUM>",
"position": 4
},
{
"token": "21,298",
"start_offset": 17,
"end_offset": 23,
"type": "<NUM>",
"position": 5
},
{
"token": "common:info:env",
"start_offset": 24,
"end_offset": 39,
"type": "<ALPHANUM>",
"position": 6
},
{
"token": "production",
"start_offset": 41,
"end_offset": 51,
"type": "<ALPHANUM>",
"position": 7
},
{
"token": "user:none:username:none:log",
"start_offset": 52,
"end_offset": 79,
"type": "<ALPHANUM>",
"position": 8
},
{
"token": "publishing",
"start_offset": 81,
"end_offset": 91,
"type": "<ALPHANUM>",
"position": 9
},
{
"token": "to",
"start_offset": 92,
"end_offset": 94,
"type": "<ALPHANUM>",
"position": 10
},
{
"token": "bus",
"start_offset": 95,
"end_offset": 98,
"type": "<ALPHANUM>",
"position": 11
},
{
"token": "user_id",
"start_offset": 100,
"end_offset": 107,
"type": "<ALPHANUM>",
"position": 12
},
{
"token": "8866",
"start_offset": 109,
"end_offset": 113,
"type": "<NUM>",
"position": 13
},
{
"token": "event_id",
"start_offset": 115,
"end_offset": 123,
"type": "<ALPHANUM>",
"position": 14
},
{
"token": "aibrbpclxcazsevrtfzvu5",
"start_offset": 125,
"end_offset": 147,
"type": "<ALPHANUM>",
"position": 15
},
{
"token": "timestamp",
"start_offset": 149,
"end_offset": 158,
"type": "<ALPHANUM>",
"position": 16
},
{
"token": "1449384441",
"start_offset": 160,
"end_offset": 170,
"type": "<NUM>",
"position": 17
},
{
"token": "quotes",
"start_offset": 172,
"end_offset": 178,
"type": "<ALPHANUM>",
"position": 18
},
{
"token": "rates",
"start_offset": 184,
"end_offset": 189,
"type": "<ALPHANUM>",
"position": 19
},
{
"token": "ueurusd",
"start_offset": 192,
"end_offset": 199,
"type": "<ALPHANUM>",
"position": 20
},
{
"token": "decimal",
"start_offset": 201,
"end_offset": 208,
"type": "<ALPHANUM>",
"position": 21
},
{
"token": "1.061025",
"start_offset": 209,
"end_offset": 217,
"type": "<NUM>",
"position": 22
},
{
"token": "ugbpusd",
"start_offset": 220,
"end_offset": 227,
"type": "<ALPHANUM>",
"position": 23
},
{
"token": "decimal",
"start_offset": 229,
"end_offset": 236,
"type": "<ALPHANUM>",
"position": 24
},
{
"token": "1.494125",
"start_offset": 237,
"end_offset": 245,
"type": "<NUM>",
"position": 25
},
{
"token": "ueurgbp",
"start_offset": 248,
"end_offset": 255,
"type": "<ALPHANUM>",
"position": 26
},
{
"token": "decimal",
"start_offset": 257,
"end_offset": 264,
"type": "<ALPHANUM>",
"position": 27
},
{
"token": "0.710150",
"start_offset": 265,
"end_offset": 273,
"type": "<NUM>",
"position": 28
},
{
"token": "event",
"start_offset": 277,
"end_offset": 282,
"type": "<ALPHANUM>",
"position": 29
},
{
"token": "accountinstrumentsupdated",
"start_offset": 284,
"end_offset": 309,
"type": "<ALPHANUM>",
"position": 30
},
{
"token": "minute",
"start_offset": 311,
"end_offset": 317,
"type": "<ALPHANUM>",
"position": 31
},
{
"token": "1449384420",
"start_offset": 319,
"end_offset": 329,
"type": "<NUM>",
"position": 32
}
]
}
短语“生产用户:无:用户名:无:LOG:发布到总线”
{
"token": "production",
"start_offset": 41,
"end_offset": 51,
"type": "<ALPHANUM>",
"position": 7
},
{
"token": "user:none:username:none:log",
"start_offset": 52,
"end_offset": 79,
"type": "<ALPHANUM>",
"position": 8
},
{
"token": "publishing",
"start_offset": 81,
"end_offset": 91,
"type": "<ALPHANUM>",
"position": 9
},
{
"token": "to",
"start_offset": 92,
"end_offset": 94,
"type": "<ALPHANUM>",
"position": 10
},
{
"token": "bus",
"start_offset": 95,
"end_offset": 98,
"type": "<ALPHANUM>",
"position": 11
}
因此,如果您搜索“发布到总线”,elasticsearch 会匹配上述三个标记并返回文档。
如果您搜索“None:LOG:发布到总线”,“None:LOG:”不完全匹配,因此不会返回文档。
您可以尝试“User:None:Username:None:LOG:Publishing to Bus”来获取结果。
关于logstash - Kibana:搜索特定短语,不返回任何结果,而另一个搜索则返回该短语,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33976989/
我们正在使用一个脚本,它会返回以下内容120007CONSULTA DE DEUDA CORRECTA.01TEST我正在尝试从awk中获得 CONSULTA DE DEUDA CORRECTA 的短
我正在使用以下查询: { "_source": [ "title", "bench", "id_", "court",
例如,我有数十亿个短语,我想要将相似的短语聚集在一起。 > strings.to.cluster <- c("Best Toyota dealer in bay area. Drive out wit
我有一个包含大约 1000 个关键字/短语(一到四个字长)的数据库表 - 这个表很少更改,所以我可以将数据提取到更有用的东西中(比如正则表达式?) - 所以这没有找到/基于自然语言处理猜测关键词..
我想确保我从一开始就做对了,但我找不到好的答案,所以我想问一下。 我要做的是以下内容。 以一句话为例:The quick brown fox jumped over the lazy dog"并使用全
我有一个表单,其中有两个单选按钮。 应该从字符串中搜索整个字符串,第二个应该搜索至少一个单词。 例如: 我将搜索“Awesome ideas for startup”。 如果我选中“搜索整个字符串/短
我有... 一组固定关键字和词组(大约 1,000,000 个),例如 birthday、happy new year、vacation等 10 到 500 字之间的一些可变文本。 我想…… 识别文本
有没有办法删除字符串中重复的和连续的单词/短语?例如。 [in]: foo foo bar bar foo bar [out]: foo bar foo bar 我试过这个: >>> s = 'thi
我正在寻找一种在文本中搜索短语或惯用表达的方法,无论时态或可能的介词/副词如何,例如如果我正在寻找 call off我还想找到 My boss called the meeting off. 之类的用
PowerShell 有一些语法特性,我找不到太多相关文档。今天我的问题是 ? {...} 例子 PS> Get-SPServiceInstance | ? {$_.GetType.toString(
我通过 PHP 使用 Solr 来搜索我网站的各个方面。我正在尝试实现一项功能,但找不到任何有关如何实现它的信息。 我有一组文档(评论),每个文档都与特定产品有关。 我想找到出现在单个产品的多条评论中
我正在从事自然语言生成任务,需要检索与 Cyc 术语等效的自然语言单词或短语。例如。 “#$EatingEvent”->“吃”或“#$Coyote-Animal”->“土狼”。 如何通过 Java A
我在使用 Java 中的以下正则表达式时遇到问题。我删除了双引号,以使其更具可读性。由于缺乏更好的词,我还将每个“组件”放在单独的行上(但实际的表达式会将行合并,行之间没有空格): (?:\bIN(?
我有一个 MySQL 数据库,我正在尝试使用 PHP 获取趋势主题(流行短语或单词)。我尝试了一些查询,但似乎没有什么对我有用。 最佳答案 您可以尝试创建一个包含两列的新表:WORD 和 COUNT,
我在 MySql 中有一个包含城市的表。 |---------------------|------------------| | ID | City
我正在处理搜索页面上的用户输入。如果用户选择“所有单词”类型的搜索,那么我会从搜索文本中删除所有 bool 搜索运算符,并在每个真实单词之间添加 ' AND '。在大多数情况下非常简单。但是,我不知道
我使用的语音识别软件给出的结果不是最佳的。 例如:session 返回为 fashion 或 mission。 现在我有一本像这样的字典: matches = { 'session': ['fas
我厌倦了使用 Gimp 无休止地滚动所有字体来不规律地搜索完美字体,所以我想:“为什么不为每种字体构建一个可视的 pangrams 列表”。 因此,我尝试构建一个 php 脚本,该脚本在 .fonts
如何编写一个 RegEx 模式来测试一个字符串是否包含多个具有以下结构的子字符串: "cake.xxx" xxx 是任何东西,但不是“奶酪”、“牛奶”或“黄油”。 例如: “我有一个 cake.hon
我有一个字段“部门”,它是一个列表:{“部门”:[“餐饮服务”,“软件开发”,“制造”,“部署”]}' 我想聚合“部门”中以“d”开头的元素。即,从所有记录进行部署。 我能够找到包含一个前缀为“d”但
我是一名优秀的程序员,十分优秀!