-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlgbtqia-streamer.conf
53 lines (52 loc) · 1.6 KB
/
lgbtqia-streamer.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
input {
twitter {
consumer_key => ""
consumer_secret => ""
oauth_token => ""
oauth_token_secret => ""
keywords => ["gay","viad","vead","homo","travesti","travec","trans","bixa","bicha","bichona","boiol","sapatão","sapata","sapatona","baitola","bisexual","bissexual","marica","lesbica","afeminado","efeminado","mariquinha"]
full_tweet => true
languages => ["pt"]
}
}
filter {
mutate {
add_field => { "[@metadata][lgbtqia_words]" => ["gay","viad","vead","homo","travesti","travec","trans","bixa","bicha","bichona","boiol","sapatão","sapata","sapatona","baitola","bisexual","bissexual","marica","lesbica","afeminado","efeminado","mariquinha"]}
}
ruby {
code => '
def get_word(hash,word)
resp = false
hash.each { |key,value|
if value.is_a?(Hash)
resp = get_word(value,word)
end
if !(value.nil?)&&(value.is_a?(String))
if (value.downcase.include? word)
resp = true
end
end
break if resp
}
return resp
end
lgbtqia_words = event.get("[@metadata][lgbtqia_words]")
event_hash = event.to_hash
lgbtqia_words.each do |word|
if (get_word(event_hash,word))
if event.get("[word]").nil?
event.set("word",[word])
else
event.set("word", [event.get("[word]"),word])
end
end
end
'
}
}
output {
sqs {
queue => "tweet_lgbtqia_queue"
region => "us-east-1"
}
}