# Copyright (c) 2012 Flowerfire, Inc. All Rights Reserved. citrix_netscaler = { plugin_version = "1.5.4" info.1.manufacturer = "Citrix" info.1.device = "NetScaler" info.1.version.1 = "8.0" info.1.version.2 = "9.0" # build 67.7 # 2007-10-22 - 1.0 - KBB - Initial creation # 2008-04-07 - 1.1 - KBB - Added support for new line format (Context lines) # 2008-09-19 - 1.2 - GMF - Added support for variant with an integer before the : # 2009-06-12 - 1.2.1 - GMF - Added support for extracting CMD_EXECUTED lines # 2009-06-18 - 1.2.2 - KBB - Added support for variant with an integer before the second : # 2009-07-16 - 1.2.3 - GMF - Fixed bug with tracking of "command" field # 2009-07-29 - 1.2.4 - GMF - Added support for Device...State lines # 2009-08-24 - 1.3 - KBB - Added support for Citrix 9.0. Also fixed duration calculation for # Context lines, added support for more Context lines, and added support for commands with # quotes in them. Grouped reports since there are so many fields now. Grouping could be better. # 2009-08-26 - 1.3.1 - KBB - Removed logging of end and delink times. Added duration calculation # for start_time and end_time. (end_time and delink_time seem always the same as date_time.) # 2009-08-27 - 1.3.2 - KBB - Added support for Monitor...State lines # 2010-12-20 - 1.3.3 - gas - added new variant (session id field) # 2012-07-14 - 1.4 - XYZ - Contributed changes by XYZ [ThreadID:1272067] # 2013-03-15 - 1.4.1 - GMF - Added support for an extra number field before the colon # 2013-09-17 - 1.4.2 - GMF - Added failure_reason. Added discarding of extra IP field at beginning of line. ThreadID:1295345. # 2013-09-20 - 1.5 - GMF - Added field-by-field parsing of log entries. Added concurrent connection analysis. # 2013-09-25 - 1.5.1 - GMF - Added parsing of additional fields in CLISEC_EXP_EVAL and CLISEC_CHECK # 2013-09-25 - 1.5.2 - GMF - Added parsing of full message from CLISEC_EXP_EVAL and CLISEC_CHECK # 2013-09-25 - 1.5.3 - GMF - Extended the maximum table value length, so the whole message appears. # 2014-05-22 - 1.5.4 - GMF - Added trimming of leading # The name of the log format log.format.format_label = "Citrix NetScaler Log Format" log.miscellaneous.log_data_type = "syslog_required" log.miscellaneous.log_format_type = "network_device" # Allow very long cell values (for the "message" field). statistics.sizes.table_cell.maximum_text_length = "1000" # The log is in this format if any of the first ten lines match this regular expression #Oct 10 22:39:13 66.36.236.66 10/10/2007:14:39:13 GMT ns : APPFW APPFW_STARTURL : 220.133.110.194 fetpoc Disallow Illegal URL: http://61.31.230.67/board/ #2007-11-09 11:25:35 Local0.Info 10.2.66.226 11/09/2007:03:25:05 GMT agee : SSLVPN TCPCONNSTAT : Context user01@10.2.66.226 - User user01 - Client_ip 10.2.66.226 - Nat_ip 10.2.66.226 - Vserver 10.2.66.236:443 - Source 10.2.66.226:1404 - Destination 127.0.0.1:80 - Start_time "11/09/2007:03:25:04 GMT" - End_time "11/09/2007:03:25:05 GMT" - Duration 00:00:01 - Total_bytes_send 463 - Total_bytes_recv 2379 - Total_compressedbytes_send 0 - Total_compressedbytes_recv 0 - Compression_ratio_send 0.00% - Compression_ratio_recv 0.00% - Access Allowed - Group(s) "accounting" #2009-06-17 17:08:41 Local0.Info 172.16.55.55 06/18/2009:01:07:20 GMT access : UI CMD_EXECUTED 8454 : User poweruser - Remote_ip 172.16.54.54 - Command "login" - Status "Success" #Aug 17 15:00:00 155.155.155.55 08/17/2009:19:00:00 GMT : TCP CONN_DELINK 170566 : Source 10.5.55.55:2567 - Vserver 155.155.155.54:443 - NatIP 155.155.155.56:49734 - Destination 155.155.155.57:9212 - Delink Time 08/17/2009:19:00:00 GMT - Total_bytes_send 0 - Total_bytes_recv 12918 #Feb 7 03:01:01 10.116.218.93 02/07/2013:08:01:01 GMT NetScaler 0-PPE-0 : SSLVPN UDPFLOWSTAT 184746 0 : Context ABC1234@somewhere.com@12.34.56.78 - SessionId: 142- User ABC1234@somewhere.com - Client_ip 23.45.67.89 - Nat_ip 11.22.33.44 - Vserver 22.33.44.55:443 - Source 127.100.0.142:55035 - Destination 33.44.55.66:53 - Start_time "02/07/2013:07:58:53 GMT" - End_time "02/07/2013:08:01:01 GMT" - Duration 00:02:08 - Total_bytes_send 48 - Total_bytes_recv 101 - Access Allowed - Group(s) "VPN IS Access" # log.format.autodetect_regular_expression = "[0-9]{2}/[0-9]{2}/[0-9]{4}:[0-9]{2}:[0-9]{2}:[0-9]{2} [^ ]+ ([^ ]*) ([A-Z0-9-]+ )?: [A-Z_]+ [A-Z_]+ ([0-9]+ )?([0-9]+ )?: " log.format.autodetect_regular_expression = "[0-9]{2}/[0-9]{2}/[0-9]{4}:[0-9]{2}:[0-9]{2}:[0-9]{2} [^ ]* [^ ]+ ([^ ]*) ([A-Z0-9-]+ )?: [A-Z_]+ [A-Z_]+ ([0-9]+ )?([0-9]+ )?: " log.format.autodetect_lines = 20000 # All log field parsing will be done using the parsing filters log.format.parse_only_with_filters = "true" log.fields = { host_name = "" application_type = "" validation_type = "" client_ip = "" application = "" url.type = "page" message = "" result = "" context = "" user = "" nat_ip = "" vserver = "" source_ip = "" source_port = "" destination_ip = "" destination_port = "" groups = "" remote_ip = "" command = "" status = "" device = "" monitor = "" state = "" browser_type.type = "agent" sslvpn_client_type = "" start_time = "" # end_time = "" # delink_time = "" duration = "" total_bytes_send = "" total_bytes_recv = "" http_resources_accessed = "" nonhttp_resources_accessed = "" total_tcp_connections = "" total_udp_flows = "" total_policies_allowed = "" total_policies_denied = "" # XYZ for Login and failed logins login = "" failed_login = "" failure_reason = "" } # log.fields log.filters = { mark_entry = { label = '$lang_admin.log_filters.mark_entry_label' comment = '$lang_admin.log_filters.mark_entry_comment' value = 'events = 1;' } # mark_entry } # log.filters log.parsing_filters.parse = ` # If there's an IP before the date, ignore it #Sep 5 11:00:01 10.68.52.21 09/05/2013:11:00:01 GMT ns PPE-1 : SSLVPN TCPCONNSTAT 3750850 : Context 012977@67.186.176.149 - SessionId: 5067- User 012977 - Client_ip 67.186.176.149 - Nat_ip 10.68.232.185 - Vserver 170.88.180.230:47873 - Source 67.186.176.149:2020 - Destination 10.78.118.35:139 - Start_time "09/05/2013:10:59:32 GMT" - End_time "09/05/2013:11:00:01 GMT" - Duration 00:00:29 - Total_bytes_send 1 - Total_bytes_recv 1 - Total_compressedbytes_send 0 - Total_compressedbytes_recv 20 - Compression_ratio_send 0.00% - Compression_ratio_recv 0.00% - Access Allowed - Group(s) "CAG Migration" if (matches_regular_expression(v.syslog_message, '^[0-9]+[.][0-9]+[.][0-9]+[.][0-9]+ (.*)$')) then v.syslog_message = $1; # CHop off leading #00:00.4,172.21.120.112,<134> 02/05/2014:08:00:00 GMT ns PPE-0 : SSLVPN HTTPREQUEST 5320169 : Context abc@12.34.56.78 - SessionId: 18110- 23.45.67.89 User abc : Group(s) ctxNS_NavUI : Vserver 98.76.54.32:47873 - 02/05/2014:08:00:00 GMT GET /Citrix/AGEE/auth/silentDetection.aspx - - if (matches_regular_expression(v.syslog_message, '^<[0-9]+> +(.*)$')) then v.syslog_message = $1; #Aug 29 11:54:32 66.66.236.66 08/29/2007:03:54:32 GMT ns : APPFW APPFW_FIELDFORMAT : 216.66.216.66 znet_hello http://hello.znet.goodbye.tw/book.jsp?id=2G024132&status=1&searchFunction=&searchContent=&searchStatus=-1&searchSO=&searchUserID=&searchStage=0&year=2007&month=08&day=29&year2=2007&month2=08&day2=29&setupyear=null&setupmonth=n Field format check failed for field searchfunction="" # 2013-03-15 - GMF - Added support for another numerical field before the colon: #Feb 7 03:01:01 10.116.218.93 02/07/2013:08:01:01 GMT NetScaler 0-PPE-0 : SSLVPN UDPFLOWSTAT 184746 0 : Context ABC1234@somewhere.com@12.34.56.78 - SessionId: 142- User ABC1234@somewhere.com - Client_ip 23.45.67.89 - Nat_ip 11.22.33.44 - Vserver 22.33.44.55:443 - Source 127.100.0.142:55035 - Destination 33.44.55.66:53 - Start_time "02/07/2013:07:58:53 GMT" - End_time "02/07/2013:08:01:01 GMT" - Duration 00:02:08 - Total_bytes_send 48 - Total_bytes_recv 101 - Access Allowed - Group(s) "VPN IS Access" if (matches_regular_expression(v.syslog_message, '^ *([0-9]{2}/[0-9]{2}/[0-9]{4}): ?([0-9]{2}:[0-9]{2}:[0-9]{2}) [^ ]* [^ ]+ ([^ ]+)? ([A-Z0-9-]+ )?: ([^ ]+) ([^ ]+) ([0-9]+ )?([0-9]+ )?: (.*)$')) then ( set_collected_field('', 'date', $1); set_collected_field('', 'time', $2); set_collected_field('', 'host_name', $3); set_collected_field('', 'application_type', $5); set_collected_field('', 'validation_type', $6); v.message = $9; # e.g. #Oct 11 02:28:30 66.36.236.66 10/10/2007:18:28:30 GMT ns : APPFW APPFW_XSS : 226.166.116.166 falcon http://falcon.hawk.com/prey/?search= Cross-site script check failed for search="