hsen-dev / vscode-elastic Goto Github PK
View Code? Open in Web Editor NEWElasticsearch for VSCode
Home Page: https://marketplace.visualstudio.com/items?itemName=ria.elastic
License: The Unlicense
Elasticsearch for VSCode
Home Page: https://marketplace.visualstudio.com/items?itemName=ria.elastic
License: The Unlicense
The dev console in Kibana allows scripts to contain line breaks, even though it's invalid JSON. You open and close the script with a triple quote: """
This make scripts far easier to read and write. It would be very useful if this plugin supported this.
Hello i am running vscode-elastic extension in my version of visual studio and i am receiving the error 'command elastic.execute not found' when trying to 'run query'. I am running on a Macbook.
In addition how do you change the elasticsearch instance configuration one submitted?
Thanks if anyone can help.
Thanks for the great extension. Please add a license
Autocomplete does not work accurately with the index names like "test_index_ver0.01". For this sample, plugin shows "test_index_ver0"- only the part which appeared before "dot"
Hi,
When I want to get payload from file - as specified in README - I got an "not_x_content_exception".
Query:
PUT /itunes-suggest
!./mapping.json
Response:
{
"error": {
"root_cause": [
{
"type": "not_x_content_exception",
"reason": "Compressor detection can only be called on some xcontent bytes or compressed xcontent bytes"
}
],
"type": "not_x_content_exception",
"reason": "Compressor detection can only be called on some xcontent bytes or compressed xcontent bytes"
},
"status": 500
}
VSCode version: 1.59.1
Extension version: v0.13.3
I can neither set the host address with the command ES: Elastic: Set Host
command 'elastic.setHost' not found
nor can I, after manually configuring the host in a .esenv file, make a query run
command 'elastic.execute' not found
I am on Ubuntu 18.04.1 LTS
VSCode is 1.31.0
Elasticsearch for VSCode is 0.13.3
Reinstalling the extension did not resolve the issue.
G'Day!
Our style guide does ask that users not change the colouring and it'd be great if you could please update the Elastic logo you are using, as seen here.
It'd also be awesome if you could change Elastic for Visual Studio Code
to Elasticsearch for Visual Studio Code
to make it clear it's for the Elasticsearch product :)
Thanks,
Mark (from Elastic)
Documents with big numeric values are presented incorrectly (rendered number is incorrect).
Please see very similar issue here: jqlang/jq#1959
Steps to reproduce:
unsigned_long
typePUT /my-test-index-000001
{
"mappings": {
"properties": {
"big_number": { "type": "unsigned_long" }
}
}
}
POST /my-test-index-000001/_doc
{
"big_number": 1234
}
POST /my-test-index-000001/_doc
{
"big_number": 1016950844191088640
}
GET /my-test-index-000001/_search
{
"size": 10
}
Incorrect because 1016950844191088640 != 1016950844191088600
GET /my-test-index-000001/_search
{
"query": {
"term": {
"big_number": 1016950844191088600
}
},
"size": 10
}
4.1 Searching for indexed value โ document found
GET /my-test-index-000001/_search
{
"query": {
"term": {
"big_number": 1016950844191088640
}
},
"size": 10
}
Hi,
when trying to do an bulk operation as described in the elasticsearch reference like this:
POST _bulk
{ "index" : { "_index" : "test", "_id" : "1" } }
{ "field1" : "value1" }
{ "delete" : { "_index" : "test", "_id" : "2" } }
{ "create" : { "_index" : "test", "_id" : "3" } }
{ "field1" : "value3" }
{ "update" : {"_id" : "1", "_index" : "test"} }
{ "doc" : {"field2" : "value2"} }
it results in an error message like this:
{
"error": {
"root_cause": [
{
"type": "illegal_argument_exception",
"reason": "The bulk request must be terminated by a newline [\\n]"
}
],
"type": "illegal_argument_exception",
"reason": "The bulk request must be terminated by a newline [\\n]"
},
"status": 400
}
How can i tell the elastic search plugin for VSCode to append a newline character?
best regards,
JohT
PS.: Really great plugin btw.
I'd like to connect to AWS Elasticsearch service host via vscode-elastic extension.
The AWS Elasticsearch service host
So, I
When I use curl command to access the Elasticsearch host, I create ssh tunnel first then use -k
option to ignore the cert issue like the following.
curl -k -XGET https://localhost:7000/_cat/health
It can give me a 200 response.
Make ssh tunnel via
ssh -f -N -L 7000:subdomain.ap-northeast-1.es.amazonaws.com:443 bastion-server-domain
Set the domain host for vscode-elastic extension.
Exec Run Query
I'd like to know if there's a way to ignore the cert issue as well as curl's k option.
Operating System:
macOS 10.14.6
Version: 1.37.0
Commit: 036a6b1d3ac84e5ca96a17a44e63a87971f8fcc8
Date: 2019-08-08T01:22:37.660Z
Electron: 4.2.7
Chrome: 69.0.3497.128
Node.js: 10.11.0
V8: 6.9.427.31-electron.0
OS: Darwin x64 18.7.0
Uninstall and re-install the plugin does not help.
When setting "elastic.showResultAsDocument": false
, no results appear. But the command does get executed. Only if setting to the default of true
do results appear.
I see there's been no activity in this repo or issues for a long time. Is this project still maintained?
From the docs elastic search use conditional clauses for search templates.
Doing this with the extension installed causes "Invalid Json" and prevents the query able to be executed.
Persist some type of data so that a new host can be added such that you can select from a list of hosts when switching hosts. I typically need to switch from development environment to beta or production environments and having to retype the host is slightly annoying.
Also plugin is great replacement for the old sense plugin ๐
Hello,
I would like the option to persist my connections in the settings.json file so I can commit them to my private repo.
Is this possible to implement?
This appears to have happened with the most recent update.
When I try to execute a query, the executing query message appears in the status bar, but it never returns results and no error message ever appears.
I've attempted to use different hosts. I have also tried prefixing the host with http://
.
I'm using version 1.24.1 of VS Code with version 0.13.1 of the plugin.
It would be nice to be able to hit something like Ctrl+Enter
to run the currently selected query.
Dear,
My es version is 7.7.0 and open authorization. after check you docs said, i need to use http://user:pass@ip:9200 connection way. after i set host and run query, the tools reports getaddrinfo error.
would you please let me know, how to fix this issue.
Many thank.
hi, thx for your powerful plugin. but i am wondering how to set different es file with different host. because i have so many es clusters. it is tedious to change host every time.
This looks awesome. Is it possible to specify protocol? Trying to use it against elastic instance at cloud.elastic.co but only getting econnreset.
Hey, awesome work on this.
I was wondering how difficult it would be to allow the following:
PUT /my-index
!./opt/elasticsearch/mapping.json
Where !./path
will load the contents of a file and use that as the body payload?
It would great to have functionality like "Copy as cURL" which formats request ready to execute in shell using curl. It seems like you can borrow this functionality from REST Client
extension.
It would be very nice if YAML input and output was supported as per https://www.elastic.co/guide/en/elasticsearch/reference/6.5/common-options.html
I am able to connect and run to following ES server using Sense while VsCode ext is giving error
getaddrinfo ENOTFOUND https https:80
The highlighting doesn't show properly all the time. And then it works if I change something, even deleting an empty line and putting it back "resets" the highlighting, but then it stops working again a few minutes later. I'm not sure what's triggering the highlighting to go back to being wrong. This happens in different files. Using latest version of vscode and this extension.
It shows wrong in various parts of the file, like the highlighting of JSON object keys and values. And sometimes the method like GET or POST is showing without highlighting.
The shortcut key to does not work when using a temporary file (not saving it).
If I Ctrl + Enter
just a blank line is inserted. If I remap the key, VSCode tells me The key combination (...) is not a command.
If I'm now saving this file, both the default and the remapped key binding works as expected.
Version 0.13.2
I can't close the results tab using the default shortcut of ctrl + w
. If I press it on another tab it works but not on the results tab. I have showResultAsDocument
set to false.
please fix the secert in the report and make github actions works, and publish the new version of the extenstion
secret name : VSCE_PAT
https://github.com/hsen-dev/vscode-elastic/runs/6241944196?check_suite_focus=true
info from my pr:
you can also make the github action that run test to be required
https://docs.codemagic.io/configuration/github-checks/
and dont forget to make a github secret to make the publish github action work
add secert named VSCE_PAT (https://code.visualstudio.com/api/working-with-extensions/publishing-extension#get-a-personal-access-token)
https://docs.github.com/en/actions/security-guides/encrypted-secrets
if you need any help you can contact with me :)
Great work on the tool it already works incredibly well :).
A suggestion for an improvement I would like would to have more explicit error communication.
For instance I am getting an "invalid Json" error, but I cannot tell, where the error is occuring.
I use this often in kabana, I understand it's not valid json (which may make it hard), but support would be nice, if possible.
GET _msearch
{"index" : "index0"}
{ "query": { "multi_match": { "query":"test0" } } }
{"index" : "index1"}
{ "query": { "multi_match": { "query":"test1" } } }
Thanks
SSL protected clusters can be X-Pack or some other mechanism.
Not sure how this would be managed, configuration-wise, but it would allow testing against my actual data, instead of limiting me to unencrypted clusters.
Could we post bulk request?
Like this
POST /cars/transactions/_bulk
{ "index": {}}
{ "price" : 10000, "color" : "red", "make" : "honda", "sold" : "2014-10-28" }
{ "index": {}}
{ "price" : 20000, "color" : "red", "make" : "honda", "sold" : "2014-11-05" }
{ "index": {}}
{ "price" : 30000, "color" : "green", "make" : "ford", "sold" : "2014-05-18" }
{ "index": {}}
{ "price" : 15000, "color" : "blue", "make" : "toyota", "sold" : "2014-07-02" }
{ "index": {}}
{ "price" : 12000, "color" : "green", "make" : "toyota", "sold" : "2014-08-19" }
{ "index": {}}
{ "price" : 20000, "color" : "red", "make" : "honda", "sold" : "2014-11-05" }
{ "index": {}}
{ "price" : 80000, "color" : "red", "make" : "bmw", "sold" : "2014-01-01" }
{ "index": {}}
{ "price" : 25000, "color" : "blue", "make" : "ford", "sold" : "2014-02-12" }
I noticed that if I add querystring parameters to my query, the plugin does not recognize my block as a valid Elasticsearch query.
For example, this works fine:
GET /vision/tags/_search
{
"size" : 0,
"aggs" : {
"distinct_tags" : {
"terms": {
"field": "tag",
"size": 10
}
}
}
}
...but this breaks:
GET /vision/tags/_search?filter_path=aggregations.distinct_tags.buckets
{
"size" : 0,
"aggs" : {
"distinct_tags" : {
"terms": {
"field": "tag",
"size": 10
}
}
}
}
Thanks.
Can't change the es host for file. How and where to execute this command?
Name:
elastic.setHost
Description:
Elastic: Set Host
when I press alt+ shift + f
there is no formatter for .es file
or how could I use jsonc extension formatter?
also,I try to add settings.json
"[es]": {
"editor.defaultFormatter": "vscode.json-language-features"
}
but,no luck.I don't have much time for try something more,so I'm here to ask,thanks,bro.
When the setting elastic.showResultAsDocument is set to true (default), running queries list _cat
(where result us not JSON format) will cause a parse error when parsing result. think it is here
Can be good to support this and also there is no message or other indication that the query didn't succeed.
Hi,
First off thank you for your time developing this plugin.
When trying to connect to my private ES instance in AWS I am getting a certificate error
unable to verify the first certificate
I checked the root certificate is added to Windows OS and I am able to connect to it via browser just fine.
Is there a different certificate store I have to add this to?
Or is there a way I can troubleshoot this differently to find out the problem, the error doesn't provide much context.
Thank you!
To be consistent with kibana's dev tools console and many other programs, ctrl+enter should be able to run the command (instead of or in addition to alt+enter).
Hi,
Thanks for this very useful plugin.
I'd like to use it to run bulk requests. These requests take a payload in the format of ndjson (newline delimited json) which is not recognized by your parser.
I would like to be able to run these queries to ingest some data, like in the following tutorial:
https://opensearch.org/docs/search-plugins/knn/approximate-knn/
I would hope to put my payload inline in the .es file (currently the parser will take into account only the first line of the payload and ignore the rest) and/or from an external file (currently I get an "invalid json" error).
If reading from an external "ndjson" file is easier, I'm ok with it
Thanks in advance
The structure of elasticsearch queries can be dense. If this plugin could have snippets or autocomplete that would be great.
I have installed the extension. Opened a file .es and language switched to Elasticsearch.
I setted the ES Host.
What's the trick to make the run query command appear and the game to start?
Could we get the option to return the output as the raw JSON from Elasticsearch rather than the tree?
Hi,
How can I pass/configure below parameter to access elasticsearch
Region
Service
Access Key Id
Secret Access Key
Without that I'm seeing below error:
{
"Message": "User: anonymous is not authorized to perform: es:ESHttpGet"
}
This is working fine in Kibana plugin in browser and postman with the AWS Signature.
I really like using ctrl+enter to execute the query and find that the "Run Query" text that appears in front of each query is quite distracting (both when it pops into place and just by being there). It would be nice if you could add an option to disable that so it doesn't appear and we can just run them with ctrl+enter.
Or even better an option to disable it plus a keyboard shortcut that would let us toggle this, so if you're using the mouse a lot you can toggle it on and have them appear temporarily.
Great extension!
I was wondering if you can add support for the HEAD request
e.g.
HEAD /logs_20162801/_alias/*
(see bottom of page https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-aliases.html)
Issue Type: Bug
can not run es query when I upgread vscode to 1.46.1 error message is socket hang up
Extension version: 0.13.3
VS Code version: Code 1.46.1 (cd9ea6488829f560dc949a8b2fb789f3cdc05f5d, 2020-06-17T21:13:20.174Z)
OS version: Windows_NT x64 10.0.18363
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.