I don't think that it fails, because of java syntax. In my group[0] I can see that the latency is captrued, but then I can't extract this value from my groups.
I am pasting my java implementation as well as the output:
public static final void main(String[] args) throws IOException {
//String filePath = "c:\\Logs\\serverttmd_TestFiles\\FMT_FMTORDEQ1TCME03_CME-C_2008-11-17__SLO_.log";
String filePath = "c:\\Logs\\serverttmd_TestFiles\\FMT_FMTORDEQ1TCBT03_CBOT_2008-11-10__SLO_.log";
String filePathNetstat = "c:\\Logs\\netstat\\FMT_192.168.1.100_2008-11-21_NS_.txt";
//ServerttmdParser.SloLog(filePath);
String sourcestring = "17.11.2008 00:00:03.513 | ORDERSERVER/PROD | 3988 | INFO | 00000000 | JVV714 | OrderStatus(Routed=(sts:8202 C S O Autotrader 4 CME-C FUT 6B 0309 0.0 14751 0 L X: 0 W: 4 A15085450 TTORDERERCN1EMICHAEL A1 GTD 06:00:03.000 No. 14144932 sndr 67.202.68.182 exchange_order_id 0008F6AS sok: 09093C957) Latency=16) some junk";
Pattern re = Pattern.compile("(?=.+?OrderStatus\\(Routed=)((?:\\d\\d\\.){2}\\d{4})\\s+((?:\\d\\d:){2}\\d\\d\\.\\d+).+?OrderStatus\\(Routed=\\S+\\x20[A-Z]\\x20[A-Z]\\x20[A-Z]\\x20([A-Z\\x20]+)\\x20\\d+\\x20(CME-[A-Z])\\s\\S+\\s(\\w{2}\\x20\\d+).+?(TTORD\\S+).+?((?:\\d{1,3}\\.){3}\\d{1,3})\\x20exchange_order_id\\x20(\\w+).+?Latency=(\\d+)", Pattern.CASE_INSENSITIVE | Pattern.DOTALL);
Matcher m = re.matcher(sourcestring);
int mIdx = 0;
while (m.find()) {
for (int groupIdx = 0; groupIdx < m.groupCount(); groupIdx++) {
System.out.println("[" + mIdx + "][" + groupIdx + "] = " + m.group(groupIdx));
}
mIdx++;
}
}
Output:
init:
deps-jar:
Compiling 1 source file to C:\Development\Java\RegExTest\build\classes
compile:
run:
[0][0] = 17.11.2008 00:00:03.513 | ORDERSERVER/PROD | 3988 | INFO | 00000000 | JVV714 | OrderStatus(Routed=(sts:8202 C S O Autotrader 4 CME-C FUT 6B 0309 0.0 14751 0 L X: 0 W: 4 A15085450 TTORDERERCN1EMICHAEL A1 GTD 06:00:03.000 No. 14144932 sndr 67.202.68.182 exchange_order_id 0008F6AS sok: 09093C957) Latency=16
[0][1] = 17.11.2008
[0][2] = 00:00:03.513
[0][3] = Autotrader
[0][4] = CME-C
[0][5] = 6B 0309
[0]
= TTORDERERCN1EMICHAEL
[0][7] = 67.202.68.182
[0]
= 0008F6AS
BUILD SUCCESSFUL (total time: 0 seconds)
I am almost at a point where I would start parsing it the old fashioned way line by line with split.
Thank in advance for looking into this for me.