For Real! This is one of thousand reasons why Splunk in much much better and easy to use than Elastic. And that's why we can't sell this freakin tool with any customer for the hard of use.
With Splunk I parsed a freaking log in 20 minutes with the GUI that the product has I didn't have to code anything. And with the freakin logstash is so difficult to parse a log with any of the transforms tools it has.
Ok!! I'm now releax! Damm It!!
Well hello everyone!
I'm trying to parse a log with logstash with the famous transform plugin Grok or Dissect, it has been very difficult for me to understand how this Shi** works because the lack of examples in the learn docs of logstash, they only put one example in the docs and they think with that we are ok.
This is an example of the log:
2018259000076;0498;Creacion;2018-09-16 15:24:15;baseuser;Tienda;2018-09-16 15:24:15;MLPARRAF;Capturista;2018-09-16 15:43:07;
2018261000779;0531;Creacion;2018-09-18 19:30:37;baseuser;Tienda;2018-09-18 19:30:37;IRODRIGUEC;Capturista;2018-09-18 19:33:40;
2018298000344;0529;Creacion;2018-10-25 14:06:49;baseuser;Tienda;2018-10-25 14:06:49;KGARCIAF;Capturista;2018-10-25 14:12:22;METENAR;Analisis Documental;2018-10-25 14:16:11;
2018301000689;0535;Creacion;2018-10-28 14:55:34;baseuser;Tienda;2018-10-28 14:55:34;AJMARESR;Capturista;2018-10-28 14:57:48;ZVLOPEZS;Tienda;2018-10-28 14:59:42;MFLORESO01;Capturista;2018-10-28 15:37:58;CHVAZQUEZA;Tienda;2018-10-28 17:13:21;MFLORESO01;Capturista;2018-10-28 17:45:21;AYHEREDIAH;Tienda;2018-10-28 17:47:04;MFLORESO01;Capturista;2018-10-28 18:46:13;PBRITOA;Tienda;2018-10-28 18:49:13;KCOETOM;Capturista;2018-10-28 20:47:02;AJCRUZR;Tienda;2018-10-28 20:48:02;MEHERNANDR01;Capturista;2018-11-12 18:42:44;METENAR;Tienda;2018-11-14 09:13:00;SOSANCHEZN;Capturista;2018-11-18 12:27:20;ZVLOPEZS;Tienda;2018-11-18 12:31:21;
2018301000808;0535;Creacion;2018-10-28 15:35:55;baseuser;Tienda;2018-10-28 15:35:55;AJMARESR;Capturista;2018-10-28 15:38:40;JCGARCIAS;Tienda;2018-10-28 15:44:19;MFLORESO01;Capturista;2018-10-28 16:12:51;AYHEREDIAH;Tienda;2018-10-28 16:16:09;MFLORESO01;Capturista;2018-10-28 17:54:21;GJAZAMARC;Tienda;2018-10-28 17:56:51;MFLORESO01;Capturista;2018-10-28 18:14:08;ADRAMIREZG03;Tienda;2018-10-28 18:16:43;AJMARESR;Capturista;2018-11-02 19:47:43;MCVEGAS;Tienda;2018-11-02 20:16:42;MFLORESO01;Capturista;2018-11-11 18:03:04;PSALGADO;Tienda;2018-11-11 18:04:13;AJMARESR;Capturista;2018-11-20 19:37:21;JSACOSTAP;Tienda;2018-11-21 09:21:47;SOSANCHEZN;Capturista;2018-11-28 12:46:30;AMARTINEZG16;Tienda;2018-11-28 12:55:47;
2018307002054;0563;Creacion;2018-11-03 19:33:49;baseuser;Tienda;2018-11-03 19:33:49;LAESPINOSAB;Capturista;2018-11-03 19:37:36;DCARAPIAL;Analisis Documental;2018-11-03 19:41:59;AORTEGAN;Tienda;2018-11-03 20:27:43;TPROJAST;Capturista;2018-11-18 12:49:54;PBRITOA;Analisis Documental;2018-11-18 12:51:55;BASOTOA;Tienda;2018-11-19 16:25:06;
As you can see each event starts with one common identifier of 12 numbers that starts with 2018xxxxxxxx this is going to be the beginning of each event. But one of the first issues here is that the events don't have the same longitude.
So the thing that I want to do, is separate each event in a fields, like this:
2018259000076;0498;Creacion;2018-09-16 15:24:15;baseuser;Tienda;2018-09-16 15:24:15;MLPARRAF;Capturista;2018-09-16 15:43:07;
reason:2018259000076
store:0498
action1:Creacion
action_date1:2018-09-16 15:24:15
action_user1:baseuser
action2:Tienda
action_date2:2018-09-16 15:24:15
action_user2:MLPARRAF
action3:Capturista
action_date3:2018-09-16 15:43:07
action_user3:""
So in the events that are more longer I can use fields like (action13, action_date13 , action_user13).
I tried to use a regular expresion that Splunk gave me that works very fine in the debbuger tool of kibana, and in regex101.com, that extracts the field how I want, but at the moment I enter the regular expression in the logstash it didn't work.
I tried with dissect like this.
dissect {
mapping => {"message" => "%{solicitud} %{tienda} %{accion1} %{fecha_accion1} %{user_accion1} %{accion2} %{fecha_accion2} %{user_accion2} %{accion3} %{fecha_accion3} %{user_accion3} %{accion4} %{fecha_accion4} %{user_accion4} "}
}
but nothing doesn't work.