Advertisement
Guest User

Untitled

a guest
Jan 18th, 2017
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.22 KB | None | 0 0
  1. name, movie, role
  2. "'El Burro' Van Rankin, Jorge","Serafín (1999)",PLAYED_IN
  3. "'El Burro' Van Rankin, Jorge","Serafín (1999)",PLAYED_IN
  4. "'El Burro' Van Rankin, Jorge","Serafín (1999)",PLAYED_IN
  5. .........
  6. "A.S., Alwi","Rumah masa depan (1984)",PLAYED_IN
  7. "A.S., Giri","Sumangali (1940)",PLAYED_IN
  8. "A.S., Luis","Bob the Drag Queen: Bloodbath (2016)",PLAYED_IN
  9. "A.S., Pragathi","Suli (2016)",PLAYED_IN
  10. "A.S.F. Dancers, The","D' Lucky Ones! (2006)",PLAYED_IN
  11. .........
  12.  
  13. {
  14. "_index": "imdb13",
  15. "_type": "logs",
  16. "_id": "AVmw9JHCrsOFTsZwAmBm",
  17. "_score": 13.028783,
  18. "_source": {
  19. "@timestamp": "2017-01-18T09:42:15.149Z",
  20. "movie": [
  21. "Naomi and Ely's No Kiss List (2015)",
  22. "Staten Island Summer (2015/II)",
  23. "What Happened Last Night (2016)",
  24. ...
  25. ],
  26. "@version": "1",
  27. "name": "Abernethy, Kevin",
  28. }
  29. }
  30.  
  31. input {
  32. file {
  33. path => "/home/maeln/imdb-data/roles.csv"
  34. start_position => "beginning"
  35. }
  36. }
  37.  
  38. filter {
  39. csv {
  40. columns => [ "name", "movie" ]
  41. remove_field => ["role", "message", "host", "column3", "path"]
  42. separator => ","
  43. }
  44.  
  45. aggregate {
  46. task_id => "%{name}"
  47. code => "
  48. map['movie'] ||= []
  49. event.to_hash.each do |key,value|
  50. map[key] = value unless map.has_key?(key)
  51. map[key] << value if map[key].is_a?(Array)
  52. end
  53. "
  54. push_previous_map_as_event => true
  55. timeout => 30
  56. timeout_tags => ['aggregated']
  57. }
  58.  
  59. if "aggregated" not in [tags] {
  60. drop {}
  61. }
  62. }
  63.  
  64. output {
  65. elasticsearch {
  66. hosts => "localhost:9200"
  67. index => "imdb13"
  68. }
  69. }
  70.  
  71. {
  72. "took": 4,
  73. "timed_out": false,
  74. "_shards": {
  75. "total": 5,
  76. "successful": 5,
  77. "failed": 0
  78. },
  79. "hits": {
  80. "total": 149,
  81. "max_score": 13.028783,
  82. "hits": [
  83. {
  84. "_index": "imdb13",
  85. "_type": "logs",
  86. "_id": "AVmw9JHCrsOFTsZwAmBm",
  87. "_score": 13.028783,
  88. "_source": {
  89. "@timestamp": "2017-01-18T09:42:15.149Z",
  90. "movie": [
  91. "Naomi and Ely's No Kiss List (2015)"
  92. ],
  93. "@version": "1",
  94. "name": "Abernethy, Kevin",
  95. "tags": [
  96. "aggregated"
  97. ]
  98. }
  99. },
  100. {
  101. "_index": "imdb13",
  102. "_type": "logs",
  103. "_id": "AVmw9JHCrsOFTsZwAmBq",
  104. "_score": 12.998644,
  105. "_source": {
  106. "@timestamp": "2017-01-18T09:42:15.149Z",
  107. "movie": [
  108. "Staten Island Summer (2015/II)"
  109. ],
  110. "@version": "1",
  111. "name": "Abernethy, Kevin",
  112. "tags": [
  113. "aggregated"
  114. ]
  115. }
  116. },
  117. {
  118. "_index": "imdb13",
  119. "_type": "logs",
  120. "_id": "AVmw9JHCrsOFTsZwAmBu",
  121. "_score": 12.998644,
  122. "_source": {
  123. "@timestamp": "2017-01-18T09:42:15.150Z",
  124. "movie": [
  125. "What Happened Last Night (2016)"
  126. ],
  127. "@version": "1",
  128. "name": "Abernethy, Kevin",
  129. "tags": [
  130. "aggregated"
  131. ]
  132. }
  133. },
  134. .....
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement