# Logstash basic setup not working

**URL:** <https://discuss.elastic.co/t/logstash-basic-setup-not-working/66949>\
**Category:** Logstash\
**Created:** [November 23, 2016, 7:13am UTC](https://discuss.elastic.co/t/logstash-basic-setup-not-working/66949 "2016-11-23T07:13:30Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![rocky4bmw](https://avatars.discourse-cdn.com/v4/letter/r/6bbea6/32.png) [@rocky4bmw](https://discuss.elastic.co/u/rocky4bmw)\
**Post date:** [November 23, 2016, 7:13am UTC](https://discuss.elastic.co/t/logstash-basic-setup-not-working/66949/1 "2016-11-23T07:13:30Z")

</div>

Hi Team ,

I have installed logstash and tried to use filters to get the logs which are present locally to print. But it is not working. I get below error can you please check and help me. Please find below logstash config file

input {  
file {  
path =\> "/tmp/server/server1.logs"  
start\_position =\> "beginning"  
}  
}

filter {  
if [type] == "syslog" {  
grok {  
match =\> { "message" =\> "%{SYSLOGTIMESTAMP:syslog\_timestamp} %{SYSLOGHOST:syslog\_hostname} %{DATA:syslog\_program}(?:[%{POSINT:syslog\_pid}])?: %{GREEDYDATA:syslog\_message}" }  
add\_field =\> ["received\_at", "%{@timestamp}"]  
add\_field =\> ["received\_from", "%{host}"]  
}  
syslog\_pri { }  
date {  
match =\> ["syslog\_timestamp", "MMM d HH:mm:ss", "MMM dd HH:mm:ss"]  
}  
}  
}

output {  
stdout { codec =\> rubydebug }  
}

when I try to print I get below error message

opt/logstash/bin/logstash -f test1.conf  
Error: Expected one of #, if, ", ', } at line 2, column 1 (byte 9) after input {  
{:level=\>:error}

is something wrong which I am doing. can you please suggest.

---

<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:** [November 23, 2016, 7:20am UTC](https://discuss.elastic.co/t/logstash-basic-setup-not-working/66949/2 "2016-11-23T07:20:33Z")

</div>

Do you have some kind of garbage character at the beginning of the file? If I copy/paste what you've posted into a file and feed it to Logstash starts up just fine for me.

---

<div class="post-metadata">

**Author:** ![rocky4bmw](https://avatars.discourse-cdn.com/v4/letter/r/6bbea6/32.png) [@rocky4bmw](https://discuss.elastic.co/u/rocky4bmw)\
**Post date:** [November 23, 2016, 8:17am UTC](https://discuss.elastic.co/t/logstash-basic-setup-not-working/66949/3 "2016-11-23T08:17:51Z")

</div>

@Magnusbaeck thank you. I just created a new file it is not showing error. But when I try to print output on commandline I see below

[root@deheremap7075 conf.d]# /opt/logstash/bin/logstash -f test1.conf  
Settings: Default pipeline workers: 2  
Logstash startup completed

Why can't I see output display in command line? Is something wrong?

---

<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:** [November 23, 2016, 8:34am UTC](https://discuss.elastic.co/t/logstash-basic-setup-not-working/66949/4 "2016-11-23T08:34:37Z")

</div>

It's probably tailing the file and waiting for more input. Please read about sincedb, `sincedb_path`, and `ignore_older` in the documentation and in the archives of this site.

---

<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:** [December 21, 2016, 8:34am UTC](https://discuss.elastic.co/t/logstash-basic-setup-not-working/66949/5 "2016-12-21T08:34:56Z")

</div>

Closed on December 21, 2016, 8:34am UTC

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