microsoft_sqlprofiler_2005_db_host = { plugin_version = "1.7" # 2010-08-03 - 1.0 - Benson - Initial Creation # ps. The text qualifier of export settings should use quote ("), and discare binary data. # known issue: Could not process "Text Data" field that includes comma (,) # 2011-05-30 - 1.5 - Benson - Changed to support pipe line (|) seprated field. # 2011-05-30 - 1.6 - Benson - Add support for extra fields: DatabaseName, HostName. # 2012-04-23 - 1.7 - Tony - Fixed for EOL expression. # The name of the log format log.format.format_label = "Microsoft SQL Profiler 2005 Export with DB/Host" log.miscellaneous.log_data_type = "other" log.miscellaneous.log_format_type = "application" log.format.allow_newlines_inside_quotes = "true" #log.format.ignore_quotes = "true" log.format.autodetect_lines = "5000" # The log is in this format if any of the first ten lines match this regular expression #"25"|"13"|"select SERVERPROPERTY(N'servername')"|"Microsoft SQL Server Management Studio"|""|"sa"|""|""|""|""|"6104"|"56"|"2011-05-17 14:40:51.460000000"|"" #"RowNumber"|"EventClass"|"TextData"|"ApplicationName"|"NTUserName"|"LoginName"|"CPU"|"Reads"|"Writes"|"Duration"|"ClientProcessID"|"SPID"|"StartTime"|"EndTime" #2012-02-03 Add Database_name and hostname field #"RowNumber"|"EventClass"|"TextData"|"ApplicationName"|"NTUserName"|"LoginName"|"CPU"|"Reads"|"Writes"|"Duration"|"ClientProcessID"|"SPID"|"StartTime"|"EndTime"|"DatabaseName"|"HostName" #"12"|"45"|""|".Net SqlClient Data Provider"|""|"ep"|"0"|"0"|"0"|"0"|"1000"|"373"|"2012-01-16 15:02:28.370000000"|"2012-01-16 15:02:28.370000000"|""|"IISTA01" # The log is in this format if any of the first ten lines match this regular expression log.format.autodetect_regular_expression = "^\"[0-9]*\"\\|\"[^|]*\"\\|[^|]*\\|[^|]*\\|[^|]*\\|[^|]*\\|[^|]*\\|[^|]*\\|[^|]*\\|[^|]*\\|[^|]*\\|[^|]*\\|[^|]*\\|[^|]*\\|[^|]*\\|[.*]*" # This regular expression is used to parse the log fields out of the log entry log.format.parsing_regular_expression = "^\"([0-9]+)\"\\|\"([0-9]+)\"\\|([^|]+)\\|([^|]+)\\|([^|]+)\\|([^|]+)\\|([^|]*)\\|([^|]*)\\|([^|]*)\\|([^|]*)\\|([^|]*)\\|([^|]*)\\|([^|]*)\\|([^|]*)\\|([^|]*)\\|([^|]*)$" log.format.date_format = "auto" log.format.time_format = "auto" log.format.field_separator = "|" # Treat fields surrounded by square brackets. log.format.treat_brackets_as_quotes = "true" # Log fields log.fields = { raw_number.index = 1 event_class.index = 2 text_data.index = 3 application_name.index = 4 username.index = 5 login_name.index = 6 cpu.index = 7 reads.index = 8 writes.index = 9 duration.index = 10 client_pid.index = 11 spid.index = 12 start_timestamp.index = 13 end_timestamp.index = 14 database.index = 15 hostname.index = 16 date = "" time = "" #start_time = "" #end_time = "" events = "" } # log.fields log.parsing_filters.parse = ` # Extract date and time from start_timestamp if (matches_regular_expression(start_timestamp, '^([0-9/-]+) ([0-9:]+)')) then ( date = $1; time = $2; #start_time = $2; ); #if (matches_regular_expression(end_timestamp, '^([0-9/-]+) ([0-9:]+)')) then ( # end_time = $2; #); ` # Database fields database.fields = { date_time = "" day_of_week = "" hour_of_day = "" raw_number = "" event_class = "" text_data = "" application_name = "" username = "" login_name = "" events = "" cpu = "" duration = "" client_pid = "" spid = "" database = "" hostname = "" # start_time = "" # end_time = "" } # database.fields database.numerical_fields = { events = { default = true requires_log_field = true entries_field = true } # events cpu = { default = true requires_log_field = false type = "int" display_format_type = "integer" #aggregation_method = "average" #average_denominator_field = "entries" } reads = { default = true requires_log_field = false type = "int" display_format_type = "integer" } # reads writes = { default = true requires_log_field = false type = "int" display_format_type = "integer" } # writes duration = { default = true requires_log_field = false type = "int" display_format_type = "duration_microseconds" } } # database.numerical_fields log.filters = { convert_line_breaks = { label = "Convert newlines to HTML line breaks" comment = "This filter converts ASCII newlines to HTML line breaks, so the text_data field appears as multiple lines in the reports. It requires skip_escaping to be on for text_data (done in final_step of the plug-in)" value = `text_data = replace_all(text_data, '\\n', '
');` } 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 create_profile_wizard_options = { # How the reports should be grouped in the report menu report_groups = { date_time_group = "" } # report_groups final_step = ` # Standard final_step include "templates.admin.profiles.setup_reports_util"; string profile = "profiles." . volatile.new_profile_name; add_standard_reports(profile); # Turn on skip_escaping for text_data report field (profile . '.statistics.report_fields.text_data.skip_escaping') = true; ` } # create_profile_wizard_options } # microsoft_sqlprofiler_2005_db_host