# LogStash::Json::ParserError: Unexpected end-of-input: expected close marker for Array

**URL:** <https://discuss.elastic.co/t/logstash-unexpected-end-of-input-expected-close-marker-for-array/335071>\
**Category:** Logstash\
**Created:** [June 2, 2023, 10:54am UTC](https://discuss.elastic.co/t/logstash-unexpected-end-of-input-expected-close-marker-for-array/335071 "2023-06-02T10:54:45Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![niveditakathal](https://avatars.discourse-cdn.com/v4/letter/n/e19b73/32.png) [@niveditakathal](https://discuss.elastic.co/u/niveditakathal)\
**Post date:** [June 2, 2023, 10:54am UTC](https://discuss.elastic.co/t/logstash-unexpected-end-of-input-expected-close-marker-for-array/335071/1 "2023-06-02T10:54:46Z")

</div>

Hi Experts,

I want to ingest data from a text file (refer data.txt) to elastic using logstash and in order to achieve it, I have created the logstash.conf file as mentioned below -

logstash.conf -

```auto
input {
  file {
    path => "/temp/data.txt"
    start_position => "beginning"
    sincedb_path => "/dev/null"
    codec => multiline {
        pattern => "^Spalanzani"
        negate => true
        what => previous
        auto_flush_interval => 1
        multiline_tag => ""
        }
}
}

filter { json { source => "message" target => "eventData" remove_field => ["message"] } }

output {
stdout { }
}

```

data.txt -

```auto
 [
  {
    "id": "id",
    "name": "name",
    "Severity": "severity",
    "start_time": "start_time",
    "updated_time": "updated_time",
    "end_time": "end_time",
    "groupname": "groupname"
  },
  {
    "id": "1",
    "name": "test1",
    "Severity": "P1",
    "start_time": "60",
    "updated_time": "60",
    "end_time": "120",
    "groupname": "test_G"
  },
  {
    "id": "2",
    "name": "test2",
    "Severity": "P1",
    "start_time": "60",
    "updated_time": "60",
    "end_time": "120",
    "groupname": "test_P"
  }
]

```

However, when I test the logstash conf file, it gives an parse error -

```auto
[WARN] 2023-06-02 10:41:04.098 [[main]>worker0] json - Error parsing json {:source=>"message", :raw=>"[\n {\n \"id\": \"id\",\n \"name\": \"name\",\n...:exception=>#<LogStash::Json::ParserError: Unexpected end-of-input: expected close marker for Array (start marker at [Source: (byte[])"[

```

Could you please guide me to parse the text file.

Thanks in advance,  
Nivedita

---

<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:** [June 30, 2023, 10:54am UTC](https://discuss.elastic.co/t/logstash-unexpected-end-of-input-expected-close-marker-for-array/335071/2 "2023-06-30T10:54:53Z")

</div>

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