# Elasticsearch SQL CLI

**URL:** https://discuss.elastic.co/t/elasticsearch-sql-cli/255148
**Category:** Elasticsearch
**Created:** [November 12, 2020, 4:42am UTC](https://discuss.elastic.co/t/elasticsearch-sql-cli/255148 "2020-11-12T04:42:13Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![tusharnemade](https://avatars.discourse-cdn.com/v4/letter/t/67e7ee/32.png) [@tusharnemade](https://discuss.elastic.co/u/tusharnemade)
#### Post date: [November 12, 2020, 4:42am UTC](https://discuss.elastic.co/t/elasticsearch-sql-cli/255148/1 "2020-11-12T04:42:14Z")

</div>

Hello Team

I am using Elasticsearch version 7.8.0.

I am using elasticsearch-sql-cli ; to perform my operations on elasticsearch index.

When I am using this and redirecting its output to a logfile , its output contains

```auto
WARNING: sun.reflect.Reflection.getCallerClass is not supported. This will impact performance.
                       asticElasticE
                     ElasticE sticEla
          sticEl ticEl Elast
        lasti Elasti tic
      cEl ast icE
     icE as cEl
     icE as cEl
     icEla las El
   sticElasticElast icElas
 las last ticElast
El asti asti stic
El asticEla Elas icE
El Elas cElasticE ticEl cE
Ela ticEl ticElasti cE
 las astic last icE
   sticElas asti stic
     icEl sticElasticElast
     icE sticE ticEla
     icE sti cEla
     icEl sti Ela
      cEl sti cEl
       Ela astic ticE
         asti ElasticElasti
           ticElasti lasticElas
              ElasticElast

                       SQL
                      7.8.0

```

My Command is :

```auto
echo "select userId from myindex;" | elasticsearch-sql-cli -s http://elastic:elastic@localhost:9200 | tee myindex_userids.log

```

Could you please help me , how to get rid of this. I want only index data in my output file.

Thanks  
Tushar Nemade

---

<div class="post-metadata">

### Author: ![bogdan.pintea](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bogdan.pintea/32/45740_2.png) [@bogdan.pintea](https://discuss.elastic.co/u/bogdan.pintea)
#### Post date: [November 12, 2020, 10:30am UTC](https://discuss.elastic.co/t/elasticsearch-sql-cli/255148/2 "2020-11-12T10:30:27Z")

</div>

The tool will always print the header, currently. Feel free to open an issue asking for a parameter to execute one query on [GH](https://github.com/elastic/elasticsearch), though.  
But you can of course pipe the output through smth like `tail -n +30` to strip those first 30 lines (or whatever the right number).

---

<div class="post-metadata">

### Author: ![tusharnemade](https://avatars.discourse-cdn.com/v4/letter/t/67e7ee/32.png) [@tusharnemade](https://discuss.elastic.co/u/tusharnemade)
#### Post date: [November 12, 2020, 10:33am UTC](https://discuss.elastic.co/t/elasticsearch-sql-cli/255148/3 "2020-11-12T10:33:52Z")

</div>

But this Number say for example `+30` , would change in future release ... as my Script would execute for given Elasticsearch Cluster which will be upgraded in future based on requirements and bug fixes.

This would be unstable solution for my implementations.

`--silent` option which is given is of no use , as it should have suppressed such things.

Also there is no option for redirecting the output to a file , so that what ever data is extracted would be captured in a log file.

---

<div class="post-metadata">

### Author: ![tusharnemade](https://avatars.discourse-cdn.com/v4/letter/t/67e7ee/32.png) [@tusharnemade](https://discuss.elastic.co/u/tusharnemade)
#### Post date: [November 12, 2020, 12:08pm UTC](https://discuss.elastic.co/t/elasticsearch-sql-cli/255148/4 "2020-11-12T12:08:50Z")

</div>

Hello

As of now I am using below `sed` commands to erase the BANNER , `sql> prompt` from the output logfile.

```auto
sed -i '1,/sql>/d' ${LOG_DIR}/myindex_${DATE}.log ## remove top lines till sql prompt
sed -i '1d; $d' ${LOG_DIR}/myindex_${DATE}.log ## remove last line which has sql prompt

```

My work is done using these commands .. but I wonder this should not create any other issue in coming days ..

Thanks  
Tushar Nemade

---

<div class="post-metadata">

### Author: ![tusharnemade](https://avatars.discourse-cdn.com/v4/letter/t/67e7ee/32.png) [@tusharnemade](https://discuss.elastic.co/u/tusharnemade)
#### Post date: [November 12, 2020, 12:20pm UTC](https://discuss.elastic.co/t/elasticsearch-sql-cli/255148/5 "2020-11-12T12:20:56Z")

</div>

Also I do not have github login ... hence as of now I cannot raise this in it.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [December 10, 2020, 12:20pm UTC](https://discuss.elastic.co/t/elasticsearch-sql-cli/255148/6 "2020-12-10T12:20:56Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
