# How do you break up long lines in logstash.conf? \[answered\]

**URL:** <https://discuss.elastic.co/t/how-do-you-break-up-long-lines-in-logstash-conf-answered/48270>\
**Category:** Logstash\
**Created:** [April 24, 2016, 10:39pm UTC](https://discuss.elastic.co/t/how-do-you-break-up-long-lines-in-logstash-conf-answered/48270 "2016-04-24T22:39:06Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![kwmullet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kwmullet/32/9381_2.png) [@kwmullet](https://discuss.elastic.co/u/kwmullet)\
**Post date:** [April 24, 2016, 10:39pm UTC](https://discuss.elastic.co/t/how-do-you-break-up-long-lines-in-logstash-conf-answered/48270/1 "2016-04-24T22:39:07Z")

</div>

I'm trying to use logstash to pull some data from a REST endpoint. Some of the GET queries will have lines that are quite long. I'd like to break up really long lines like in this example...

```
input {
    http_poller {
        someRestEndpoint => {
            method => get
                url => "http://somehost/blah?blah&blah&blah&reallyLongURLThatGoesOnForThreeHundredCharactersOrMore"
        }
    }
}

```

Would anyone care to give me an example of how long config lines like this can be broken up in the logstash.conf?

I've tried consecutive strings:

```
"first half of the really long line"
"second half of the really long line"

```

but logstash didn't like that. Nor did it like trying to concatenate with a '+':

```
"first half of the really long line" +
"second half of the really long line"

```

Out of desperation, I've even tried

```
"first half of the really long line" \
"second half of the really long line"

```

and

```
"first half of the really long line" + \
"second half of the really long line"

```

no joy.

I'm hoping one or more of the more seasoned logstash users (or Elastic folks) could either suggest an approach that involves embedding ruby in my config OR some other approach I haven't thought of yet.

In response to the probably "why would you want to do that??":  
I'd like to keep my configs as readable as possible, and easily maintainable.

Thanks!

-KwM-

---

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [April 25, 2016, 5:33am UTC](https://discuss.elastic.co/t/how-do-you-break-up-long-lines-in-logstash-conf-answered/48270/2 "2016-04-25T05:33:56Z")

</div>

I don't think there's a way to break up string literals in the Logstash configuration DSL.

---

<div class="post-metadata">

**Author:** ![kwmullet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kwmullet/32/9381_2.png) [@kwmullet](https://discuss.elastic.co/u/kwmullet)\
**Post date:** [April 25, 2016, 10:16am UTC](https://discuss.elastic.co/t/how-do-you-break-up-long-lines-in-logstash-conf-answered/48270/3 "2016-04-25T10:16:47Z")

</div>

Thanks, Magnus.

Yeah, I suspected as such. I was hoping that there might be a way to drop down to ruby...

`ruby{ some code to muck about with the literal value }`

I haven't been able to come up with anything yet, though. I'm beginning to suspect I much just have to live with long lines. Is so, maybe I'll put in an enhancement request.

---

<div class="post-metadata">

**Author:** ![kwmullet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kwmullet/32/9381_2.png) [@kwmullet](https://discuss.elastic.co/u/kwmullet)\
**Post date:** [April 26, 2016, 7:07pm UTC](https://discuss.elastic.co/t/how-do-you-break-up-long-lines-in-logstash-conf-answered/48270/4 "2016-04-26T19:07:41Z")

</div>

I ultimately found that I was able to break up long lines _within_ the literal itself.

This worked just fine for me.

```
input {
    exec {
        command => "http_proxy='http://proxy.someplace.com:8080' \
                     https_proxy='http://proxy.someplace.com:8080' \
                    /opt/sandbox/kwm/projects/itilIntegrationMonitoring/sideDoor \
                    incident \
                   'sys_created_onRELATIVEGE@minute@ago@30^sys_created_by=monitoring.integration' "
        interval => 300
        codec => "plain"
    }
}
```

---

<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:** [July 6, 2017, 5:00am UTC](https://discuss.elastic.co/t/how-do-you-break-up-long-lines-in-logstash-conf-answered/48270/5 "2017-07-06T05:00:28Z")

</div>


