Skip to content

Instantly share code, notes, and snippets.

@asoltanipanah
Last active April 6, 2023 16:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save asoltanipanah/8c400ee6ddcf39a0d3bdb2b737bc7836 to your computer and use it in GitHub Desktop.
Save asoltanipanah/8c400ee6ddcf39a0d3bdb2b737bc7836 to your computer and use it in GitHub Desktop.
# logstash config file has three sections:
# input{}, output{}, and (optional) filter{}; add plugins
# to specify how events should be handled in each section
input {
twitter {
# set key and token values from the previous step
consumer_key => "YOUR_CONSUMER_KEY"
consumer_secret => "YOUR_CONSUMER_SECRET"
oauth_token => "YOUR_OAUTH_CODE"
oauth_token_secret => "YOUR_OAUTH_TOKEN_SECRET"
# assume we are interested in tracking all family violence tweets
keywords => ["twitterdown"]
languages => ["en"]
locations => "113.338953078,-43.6345972634,153.569469029,-10.6681857235"
full_tweet => true
ignore_retweets => true
}
}
output {
elasticsearch {
hosts => ["http://localhost:9200"]
index => "tweets"
}
stdout {
# include this to pretty-print the event's json to stdout
codec => rubydebug
}
}
@catherinewills
Copy link

I put this in and it gave me, zsh: parse error near `}'
I'm using MacOS Big Sur and homebrew .

Do I call up the logstash using cd first then go into the bin then do this? Or??

@asoltanipanah
Copy link
Author

I put this in and it gave me, zsh: parse error near `}'
I'm using MacOS Big Sur and homebrew .

Do I call up the logstash using cd first then go into the bin then do this? Or??

Hi @cjw62600. The config file works fine for me. Maybe double check to see if you are missing any bracket? Read more here for configuring Logstash: https://www.elastic.co/guide/en/logstash/current/configuration.html

You many need to cd to bin first before start streaming with logstash. Double check the directory layout for homebrew installs: https://www.elastic.co/guide/en/elasticsearch/reference/current/brew.html

@chanwitkepha
Copy link

chanwitkepha commented Sep 15, 2021

Please advise how can I change location to other country than Australia. Because I try to change but Logstash show error as seen below. But when I use your location in example, everything is OK.

image

image

@worhlali
Copy link

worhlali commented Apr 6, 2023

How do I go about creating the .conf file? I am new to coding

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment