# How to make command line -e working in linux, this is basic

**URL:** https://discuss.elastic.co/t/how-to-make-command-line-e-working-in-linux-this-is-basic/222115
**Category:** Logstash
**Created:** [March 4, 2020, 4:26pm UTC](https://discuss.elastic.co/t/how-to-make-command-line-e-working-in-linux-this-is-basic/222115 "2020-03-04T16:26:59Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![rkhapre](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rkhapre/32/48333_2.png) [@rkhapre](https://discuss.elastic.co/u/rkhapre)
#### Post date: [March 4, 2020, 4:27pm UTC](https://discuss.elastic.co/t/how-to-make-command-line-e-working-in-linux-this-is-basic/222115/1 "2020-03-04T16:27:00Z")

</div>

Hi All

I have a conf file, below is the example  
When i run this in linux machine with a .conf file file, it work perfectly with command line -f

`

> .logstash --debug -f test.conf

`

below is the conf file

```
> input {
> elasticsearch {
> hosts => ["localhost.com:9200"]
> ssl => true
> ssl_certificate_verification => false
> user => "abcd"
> password => "xyz"
> index => "testing"
> size => 10
> }
> }
> 
> filter {
> 
> 
> }
> 
> output {
> stdout { codec => rubydebug }
> 
> s3{
> access_key_id => "sddsdsdsdsd"
> secret_access_key => "sdsdsdsdsddsdsdsdsdds"
> region => "ap-south-1"
> bucket => "trial"
> size_file => 1234
> time_file => 15
> 
> }
> }

```

but when i run the same content with command line flag like this -e, it does not work

i am just converting the whole content of my conf file from to a single command like below, i get different error.

Do i need to escape each and every line?  
Do we have a better solution to just use the conf file directly with command line flag -e

So i dont have to escape each /n, "", '' etc. How to fix this issue , any idea?

> logstash --log.level debug -e "input { elasticsearch { hosts =\> ["[localhost.com:9200](http://localhost.com:9200)"] ssl =\> true ssl\_certificate\_verification =\> false user =\> "abcd" password =\> "xyz" index =\> "testing" size =\> 10 } } filter { } output { stdout { codec =\> rubydebug } s3{ access\_key\_id =\> "sddsdsdsdsd" secret\_access\_key =\> "sdsdsdsdsddsdsdsdsdds" region =\> "ap-south-1" bucket =\> "trial" size\_file =\> 1234 time\_file =\> 15 } }"

Thanks

---

<div class="post-metadata">

### Author: ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)
#### Post date: [March 4, 2020, 5:32pm UTC](https://discuss.elastic.co/t/how-to-make-command-line-e-working-in-linux-this-is-basic/222115/2 "2020-03-04T17:32:57Z")

</div>

> [@rkhapre](#):
>
> Do i need to escape each and every line?

You can concatenate everything into a single line. You will need to escape every double quote if you use double quotes to surround the configuration, but you should be able to use single quotes around the configuration.

---

<div class="post-metadata">

### Author: ![rkhapre](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rkhapre/32/48333_2.png) [@rkhapre](https://discuss.elastic.co/u/rkhapre)
#### Post date: [March 4, 2020, 5:55pm UTC](https://discuss.elastic.co/t/how-to-make-command-line-e-working-in-linux-this-is-basic/222115/3 "2020-03-04T17:55:51Z")

</div>

Okay, thanks for the response. What if i have xml tags with double quotes?  
and by concatenate you mean , i should do join to make it single line?

Thanks

---

<div class="post-metadata">

### Author: ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)
#### Post date: [March 4, 2020, 6:19pm UTC](https://discuss.elastic.co/t/how-to-make-command-line-e-working-in-linux-this-is-basic/222115/4 "2020-03-04T18:19:49Z")

</div>

All of the double quotes would need to be escaped.

Yes, I mean the entire configuration can be a single line.

---

<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: [April 1, 2020, 6:30pm UTC](https://discuss.elastic.co/t/how-to-make-command-line-e-working-in-linux-this-is-basic/222115/5 "2020-04-01T18:30:36Z")

</div>

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