# How to process a text file separated by spaces using logstash?

**URL:** <https://discuss.elastic.co/t/how-to-process-a-text-file-separated-by-spaces-using-logstash/125311>\
**Category:** Logstash\
**Created:** [March 23, 2018, 6:31am UTC](https://discuss.elastic.co/t/how-to-process-a-text-file-separated-by-spaces-using-logstash/125311 "2018-03-23T06:31:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mak705](https://avatars.discourse-cdn.com/v4/letter/m/c89c15/32.png) [@mak705](https://discuss.elastic.co/u/mak705)\
**Post date:** [March 23, 2018, 6:31am UTC](https://discuss.elastic.co/t/how-to-process-a-text-file-separated-by-spaces-using-logstash/125311/1 "2018-03-23T06:31:12Z")

</div>

My log file

maker model mileage manufacture\_year engine\_displacement engine\_power body\_type color\_slug stk\_year transmission door\_count seat\_count fuel\_type date\_created date\_last\_seen price\_eur ford galaxy 151000 2011 2000 103 None man 5 7 diesel 2015-11-14 18:10:06.838319+00 2016-01-27 20:40:15.46361+00 10584.75 skoda octavia 143476 2012 2000 81 None man 5 5 diesel 2015-11-14 18:10:06.853411+00 2016-01-27 20:40:15.46361+00 8882.31 bmw 97676 2010 1995 85 None man 5 5 diesel 2015-11-14 18:10:06.861792+00 2016-01-27 20:40:15.46361+00 12065.06 skoda fabia 111970 2004 1200 47 None man 5 5 gasoline 2015-11-14 18:10:06.872313+00 2016-01-27 20:40:15.46361+00 2960.77 skoda fabia 128886 2004 1200 47 None man 5 5 gasoline 2015-11-14 18:10:06.880335+00 2016-01-27 20:40:15.46361+00 2738.71

Error is below [2018-03-23T11:35:20,226][ERROR][logstash.agent]Failed to execute action {:action=\>LogStash::PipelineAction::Create/pipeline\_id:main, :exception=\>"LogStash::PluginLoadingError", :message=\>"Couldn't find any filter plugin named 'txt'. Are you sure this is correct?

My conf file is below

input {file {path =\> "/home/elk/data/logklda.txt"start\_position =\> "beginning" sincedb\_path =\> "/dev/null"}}  
filter{txt {separator =\> " "columns =\> ["name","type","category","date","error\_log"]}} output {elasticsearch {hosts =\> "localhost"index =\> "logklda"document\_type =\> "category"}stdout{}}

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [March 24, 2018, 8:40am UTC](https://discuss.elastic.co/t/how-to-process-a-text-file-separated-by-spaces-using-logstash/125311/2 "2018-03-24T08:40:04Z")

</div>

You can find a list of available Logstash filter plugins [here](https://www.elastic.co/guide/en/logstash/current/filter-plugins.html). As you can see there is no `txt` plugin. This seems to be data separated by spaces, so using a [csv](https://www.elastic.co/guide/en/logstash/current/plugins-filters-csv.html) filter with a `' '` separator might work. Another option might be to use the [dissect](https://www.elastic.co/guide/en/logstash/current/plugins-filters-dissect.html) filter, which is more powerful and possibly also faster.

---

<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 21, 2018, 8:40am UTC](https://discuss.elastic.co/t/how-to-process-a-text-file-separated-by-spaces-using-logstash/125311/3 "2018-04-21T08:40:17Z")

</div>

Closed on April 21, 2018, 8:40am UTC

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