Advertisement
Guest User

Untitled

a guest
Oct 25th, 2016
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. alerts = stream
  2. .window(Durations.seconds(WINDOW_SIZE)) //5 sec window
  3. .filter((Event event) -> event.action.equals("denied")) // all events with action = denied
  4. //Now I need to count every pair (user,ip)
  5. // for instance if I have:
  6. // 3,Joe,denied,1.1.1.4
  7. // 4,Cloe,denied,1.1.1.5
  8. // 5,Joe,denied,1.1.1.4
  9. // I want the aggregated events with the count value set: (_,Joe,"denied",1.1.1.4,2) and (_,Cloe,"denied",1.1.1.5,1)
  10. .filter((Event event) -> event.count >= 10); //after that I only need to filter-out events with count < 10
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement