【文件属性】:
文件名称:spl2dsl:使用Peg.js将Splunk SPL转换为Elasticsearch DSL
文件大小:98KB
文件格式:ZIP
更新时间:2021-05-18 09:08:05
elasticsearch splunk dsl pegjs JavaScript
Splunk-SPL-to-ElasticSearch-DSL
基于 Splunk 的 SPL 查询语言转换成 ElasticSearch 的 DSL。
转换结果和 对齐。
可以配置 进行表达式搜索。
Usage
const converter = require("./lib/converter")
try {
const { target, dev } = converter.parse(`| search a=1 and b=2`);
// 完整的es搜索语句
console.log(target)
// 一些查询字段值,目前只存放了时间范围
// 以后可以在基础上拓展,返回所有的查询字段,方便自定义校验字段名和字段值
console.log(dev)
} catch (error) {
console.log(error.message);
}
<s
【文件预览】:
spl2dsl-master
----.babelrc(73B)
----index.js(77B)
----package.json(997B)
----test()
--------index.test.js(26KB)
--------.gitkeep(0B)
--------es-sql-translate.md(5KB)
----gulpfile.js(1KB)
----examples()
--------index.js(184B)
--------index.html(5KB)
----.gitignore(24B)
----CHANGELOG.md(121B)
----lib()
--------splunk.pegjs(17KB)
--------converter.min.js(26KB)
--------converter.js(119KB)
----README.md(9KB)
----yarn.lock(235KB)
----.editorconfig(259B)