Guest User

Untitled

a guest
May 1st, 2015
228
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.62 KB | None | 0 0
  1. Can i have the below data structure as an output from any of the output filters in logstash. What i'm able to achieve so far is to just have a single level of dictionary like,
  2.  
  3.  
  4. "output": "xxx"
  5. "name": "ccc"
  6.  
  7. but how can i have a dictionary inside a list as in the final output...I know that i'd have to write some custom filter for the same. But what i don't understand is it even possible to have the format of the output as below.
  8.  
  9. "status-change": [
  10. {
  11. "event-time": {
  12. "perceived-severity": "",
  13. "alarm-text": "",
  14. "root-cause": ""
  15. }
  16. }
  17.  
  18.  
  19. The final output when sent out from logstash should look this way.
  20.  
  21. {
  22. "id": "6fef093e-fa75-4e0b-afb7-4aa8dd5b8358",
  23. "client": {
  24. "name": "elastigirl1",
  25. "address": "10.199.0.0",
  26. "subscriptions": [
  27. "test"
  28. ],
  29. "version": "0.16.0",
  30. "timestamp": 1430345716
  31. },
  32. "check": {
  33. "alarm-id": "",
  34. "name": "kumoakshay",
  35. "is_cleared": "",
  36. "last-alarm-text": "",
  37. "last-alarm-handling-change": "",
  38. "output": "",
  39. "status": 2,
  40. "status-change": [
  41. {
  42. "event-time": {
  43. "perceived-severity": "",
  44. "alarm-text": "",
  45. "root-cause": ""
  46. }
  47. },
  48. {
  49. "event-time": {
  50. "perceived-severity": "",
  51. "alarm-text": "",
  52. "root-cause": ""
  53. }
  54. }
  55. ],
  56. "handler": "email",
  57. "description": "AP configuration update failed",
  58. "venue_name": "",
  59. "issued": 1430345734,
  60. "history": [
  61. "2"
  62. ]
  63. },
  64. "occurrences": 1,
  65. "action": "create"
  66. }
Advertisement
Add Comment
Please, Sign In to add comment