I was in the MySQL forum asking about my problem and feherke told me to try and use AWK to do it. So here i am. And i have never used AWK before.
I have a program that logs various event logs into a database. I am using Navicat to generate reports from MySQL. Problem is, the entire event log is stored in one field in MySQL. I would like to extract a few non-consecutive lines and only have the query display those back. For example:
For this one i would want only the Logon Failure:, Reason, User Name, and Workstation name. However, all events do not have the same "fields." The event is formatted with carriage return line feeds after each section, which could possibly be used to help divide up what i want.
Can i use awk just within a query to return the results of the script?
I would probably eventually set up if statements to determine what type of event each one was and then mine out whatever data i needed depending on the type of event.
If anyone could please help me set up a script or point me in the right direction for what I need, if it is even possible, then that would be great.
Thanks
I have a program that logs various event logs into a database. I am using Navicat to generate reports from MySQL. Problem is, the entire event log is stored in one field in MySQL. I would like to extract a few non-consecutive lines and only have the query display those back. For example:
Code:
Logon Failure:
Reason: Account logon time restriction violation
User Name: joebob
Domain: DOMAIN
Logon Type: 10
Logon Process: User32
Authentication Package: Negotiate
Workstation Name: JOEBOB_COMP
Caller User Name: JOEBOB_COMP
Caller Domain: DOMAIN
Caller Logon ID: (0x0,0x3E7)
Caller Process ID: 5324
Transited Services: -
Source Network Address: 192.168.1.14
Source Port: 4639
For this one i would want only the Logon Failure:, Reason, User Name, and Workstation name. However, all events do not have the same "fields." The event is formatted with carriage return line feeds after each section, which could possibly be used to help divide up what i want.
Can i use awk just within a query to return the results of the script?
I would probably eventually set up if statements to determine what type of event each one was and then mine out whatever data i needed depending on the type of event.
If anyone could please help me set up a script or point me in the right direction for what I need, if it is even possible, then that would be great.
Thanks