Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- name, movie, role
- "'El Burro' Van Rankin, Jorge","Serafín (1999)",PLAYED_IN
- "'El Burro' Van Rankin, Jorge","Serafín (1999)",PLAYED_IN
- "'El Burro' Van Rankin, Jorge","Serafín (1999)",PLAYED_IN
- .........
- "A.S., Alwi","Rumah masa depan (1984)",PLAYED_IN
- "A.S., Giri","Sumangali (1940)",PLAYED_IN
- "A.S., Luis","Bob the Drag Queen: Bloodbath (2016)",PLAYED_IN
- "A.S., Pragathi","Suli (2016)",PLAYED_IN
- "A.S.F. Dancers, The","D' Lucky Ones! (2006)",PLAYED_IN
- .........
- {
- "_index": "imdb13",
- "_type": "logs",
- "_id": "AVmw9JHCrsOFTsZwAmBm",
- "_score": 13.028783,
- "_source": {
- "@timestamp": "2017-01-18T09:42:15.149Z",
- "movie": [
- "Naomi and Ely's No Kiss List (2015)",
- "Staten Island Summer (2015/II)",
- "What Happened Last Night (2016)",
- ...
- ],
- "@version": "1",
- "name": "Abernethy, Kevin",
- }
- }
- input {
- file {
- path => "/home/maeln/imdb-data/roles.csv"
- start_position => "beginning"
- }
- }
- filter {
- csv {
- columns => [ "name", "movie" ]
- remove_field => ["role", "message", "host", "column3", "path"]
- separator => ","
- }
- aggregate {
- task_id => "%{name}"
- code => "
- map['movie'] ||= []
- event.to_hash.each do |key,value|
- map[key] = value unless map.has_key?(key)
- map[key] << value if map[key].is_a?(Array)
- end
- "
- push_previous_map_as_event => true
- timeout => 30
- timeout_tags => ['aggregated']
- }
- if "aggregated" not in [tags] {
- drop {}
- }
- }
- output {
- elasticsearch {
- hosts => "localhost:9200"
- index => "imdb13"
- }
- }
- {
- "took": 4,
- "timed_out": false,
- "_shards": {
- "total": 5,
- "successful": 5,
- "failed": 0
- },
- "hits": {
- "total": 149,
- "max_score": 13.028783,
- "hits": [
- {
- "_index": "imdb13",
- "_type": "logs",
- "_id": "AVmw9JHCrsOFTsZwAmBm",
- "_score": 13.028783,
- "_source": {
- "@timestamp": "2017-01-18T09:42:15.149Z",
- "movie": [
- "Naomi and Ely's No Kiss List (2015)"
- ],
- "@version": "1",
- "name": "Abernethy, Kevin",
- "tags": [
- "aggregated"
- ]
- }
- },
- {
- "_index": "imdb13",
- "_type": "logs",
- "_id": "AVmw9JHCrsOFTsZwAmBq",
- "_score": 12.998644,
- "_source": {
- "@timestamp": "2017-01-18T09:42:15.149Z",
- "movie": [
- "Staten Island Summer (2015/II)"
- ],
- "@version": "1",
- "name": "Abernethy, Kevin",
- "tags": [
- "aggregated"
- ]
- }
- },
- {
- "_index": "imdb13",
- "_type": "logs",
- "_id": "AVmw9JHCrsOFTsZwAmBu",
- "_score": 12.998644,
- "_source": {
- "@timestamp": "2017-01-18T09:42:15.150Z",
- "movie": [
- "What Happened Last Night (2016)"
- ],
- "@version": "1",
- "name": "Abernethy, Kevin",
- "tags": [
- "aggregated"
- ]
- }
- },
- .....
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement