I would like to be able to convert KQL to Lucene in my NodeJS application that uses the Kibana API to create rules.
In this I see fromExpression(expression) and toElasticsearchQuery(node, indexPattern) does exactly that =)
TypeScript is new to me, and also working with so large code bases as Kibana, so I am compeltely blank on where and how to extract the files I would need and how to compile them to ES6+ afterwards.
Is there a Kibana developer out there that can help me with this? =)
If you are new to Typescript I would recommend cloning a starter like this one to get you started.
Then you should be able to have the "kbn-es-query" folder in the "src" folder of your project. But this might be a license infringement so I would suggest that you write first an email to elastic_license@elastic.co to verify that what you would like to do is OK under our license terms.
I have now looked at the licenses, and there seams to be 3 depending on which files one would like to use. My boss proposes I get an exact list of the files I need before contacting elastic_license@elastic.co .
So my current thinking is just to get it to compile, but I get the below errors. Can you figure out what I am doing wrong?
git clone https://github.com/stemmlerjs/simple-typescript-starter
cd simple-typescript-starter/
npm install
cp -a ~/kibana/packages/kbn-es-query/ src/
npm install @types/lodash
npm install @kbn/utility-types
npm run build
Yes indeed you will need to bring over all the other package dependencies. And probably change the imports from absolute imports (e.g. import { <something> } from '@kbn/utility-types') to relative imports (import { <something> } from '../../@kbn-utility-types')
Another option is to compile the packages and place them in the node_modules folder. But that has its own part of difficulties.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.