Class: LogMagic::SearchkickRefiner
Instance Attribute Summary
Attributes inherited from BaseRefiner
#lines
Instance Method Summary
collapse
Methods inherited from BaseRefiner
#initialize, #matches?, #persistance_layer
Instance Method Details
#compute ⇒ Object
6
7
8
9
10
11
12
13
14
|
# File 'lib/log_magic/refiners/searchkick_refiner.rb', line 6
def compute
elasticsearch_url =
persist_elasticsearch_url(elasticsearch_url)
query_json =
persist_query_json(query_json)
output(query_json, persistance_layer.uuid)
end
|
25
26
27
|
# File 'lib/log_magic/refiners/searchkick_refiner.rb', line 25
def
@lines.last.match(/https?:\/\/[^\/]*\/[^\/]*/)[0]
end
|
21
22
23
|
# File 'lib/log_magic/refiners/searchkick_refiner.rb', line 21
def
@lines.last.match(/(?<=[^\{])\{.*\}/)[0]
end
|
#line_match_regex ⇒ Object
2
3
4
|
# File 'lib/log_magic/refiners/searchkick_refiner.rb', line 2
def line_match_regex
/Search[^c]*curl/
end
|
#output(query_json, uuid) ⇒ Object
16
17
18
19
|
# File 'lib/log_magic/refiners/searchkick_refiner.rb', line 16
def output(query_json, uuid)
searchkick_printer = ::LogMagic::SearchkickPrinter.new(query_json, uuid)
searchkick_printer.print
end
|
#persist_elasticsearch_url(elasticsearch_url) ⇒ Object
33
34
35
|
# File 'lib/log_magic/refiners/searchkick_refiner.rb', line 33
def persist_elasticsearch_url(elasticsearch_url)
persistance_layer.add_value('elasticsearch_url', elasticsearch_url)
end
|
#persist_query_json(query_json) ⇒ Object
29
30
31
|
# File 'lib/log_magic/refiners/searchkick_refiner.rb', line 29
def persist_query_json(query_json)
persistance_layer.add_value('query_json', query_json)
end
|