# Noob question

**URL:** https://discuss.elastic.co/t/noob-question/99093
**Category:** Logstash
**Created:** [September 1, 2017, 7:02am UTC](https://discuss.elastic.co/t/noob-question/99093 "2017-09-01T07:02:26Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Eliwe](https://avatars.discourse-cdn.com/v4/letter/e/5f8ce5/32.png) [@Eliwe](https://discuss.elastic.co/u/Eliwe)
#### Post date: [September 1, 2017, 7:02am UTC](https://discuss.elastic.co/t/noob-question/99093/1 "2017-09-01T07:02:26Z")

</div>

Hello, i new to logstash i wrestingling abit with getting json input that i want to send to http output.  
My Json looks like this:

```auto
{
          "Space" => {
        "SpaceId" => "4510"
    },
    "HttpRequest" => {
            "UserAgent" => "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.101 Safari/537.36",
               "Method" => "POST",
              "Browser" => "Google Chrome"
    },
    "CurrentUser" => {
          "SecurityId" => "323cd22e-32b1-481f-a4d5-bc95b76f174e",
          "ContractId" => "9fe4effd-6f41-4a25-b965-c4c25bdbccc6",
        "ContractName" => "ElisKontrakt"
    },
       "ListName" => "Elis DataSet222",
            "@mt" => "Created list {ListName}, {StoreLog}",
        "LogType" => "Audit",
             "@l" => "Information",
             "@m" => "Created list \"Elis DataSet222\", True",
         "System" => {
        "IsScheduler" => false,
    },
       "StoreLog" => true,
    "_index_name" => "MyRedisIndex",
     "@timestamp" => 2017-08-30T08:20:37.998Z,
             "@t" => "2017-08-30T07:50:00.6050142Z",
       "@version" => "1"
}

```

I want to post the listname and current user securityId. This is my input:

```auto
input { 
  redis {
    host => "10.0.75.1"
    data_type => "list"
    key => "mylog"
	codec => "json_lines"
    # batch_count => 1
    # threads => 1
  }
}

```

Can someone kind person help me with how I read the json field and including it in my post. I have manage to post but not include any of the incomming values.  
Any help is most appriciated.  
Regards  
Elis.

---

<div class="post-metadata">

### Author: ![guyboertje](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/guyboertje/32/31592_2.png) [@guyboertje](https://discuss.elastic.co/u/guyboertje)
#### Post date: [September 5, 2017, 9:47am UTC](https://discuss.elastic.co/t/noob-question/99093/2 "2017-09-05T09:47:05Z")

</div>

The string you get from Redis, is it 'pretty printed' like in your post above?

If yes, then it will not work.

Logstash JSON codecs expect a single line with one JSON object or a single line of one JSON array with JSON objects in the array.

A codec called `json_pretty` might be published soon that would help. Watch [https://github.com/logstash-plugins](https://github.com/logstash-plugins) for progress.

---

<div class="post-metadata">

### Author: ![guyboertje](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/guyboertje/32/31592_2.png) [@guyboertje](https://discuss.elastic.co/u/guyboertje)
#### Post date: [September 5, 2017, 1:38pm UTC](https://discuss.elastic.co/t/noob-question/99093/3 "2017-09-05T13:38:03Z")

</div>

Another option, perhaps better, is to use the plain codec and the json filter. In other words, just receive the text as is and decode it later with the json filter.

---

<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: [October 3, 2017, 1:49pm UTC](https://discuss.elastic.co/t/noob-question/99093/4 "2017-10-03T13:49:38Z")

</div>

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