Posts

Showing posts from August 16, 2018

Extracting 2 dates from log file with specific patterns and compare the 2 dates

Image
Clash Royale CLAN TAG #URR8PPP up vote 0 down vote favorite It seems I have problems with my connection pool tool. There is a big delay when it obtains the DB connection. What I try to achieve is to get all the cases from log file when this incident occurs. The related log entries look like ... 2018-03-12 16:18:44,070 efault task-166 gine.jdbc.internal.LogicalConnectionImpl DEBUG Obtaining JDBC connection ... 2018-03-12 16:20:23,172 efault task-166 gine.jdbc.internal.LogicalConnectionImpl DEBUG Obtained JDBC connection ... So if the pattern ' DEBUG Obtaining JDBC connection ' occurs then extract the date ' 2018-03-12 16:18:44,070 ' and when the pattern ' DEBUG Obtained JDBC connection ' is found then extract its date and compare the 2 dates. If the difference is more than 2 sec then log then. I know it is pretty complicated to solve it with one line of code but is it possible without writing a program to do that? shell-script logs date share |

I get error when I want to execute my program from /home

Image
Clash Royale CLAN TAG #URR8PPP up vote 0 down vote favorite I have compiled my code in this path : /home/m/ChatScript-master/SRC and created executable file myapp . I can run it from inside the SRC folder like ./myapp . But when I try /home/m/ChatScript-master/SRC/myapp from my /home/m it gives me: in cs_init.txt at 0: Error opening utf8writeappend file LOGS/startlog.txt: No such file or directory Why do I get this error message? My main problem is that, I want to build a kiosk like system and want to add my executable file inside : /home/m/.config/openbox/autostart like this: $ cat /home/m/.config/openbox/autostart echo 7 > /tmp/yy /home/m/ChatScript-master/SRC/myapp & echo 8 > /tmp/yy2 But it doesn't work! I could do it already with other programs, but this program gives me this error! NOTE: There are some folders inside ChatScript-master directory like SRC and LOGS and my executable file is inside SRC folder. ubuntu autostart share | impr