cancel
Showing results for 
Search instead for 
Did you mean: 

How to Display user agent information(mozzila,ie,chrome) in security log?

joo_mariano2
Participant
0 Kudos

Hello ALL.

We need to put the user-agent information (like Mozilla 4.0, IE9. Chrome...) in security log.

I tried some things but without success.

Searching in SCN, and xSearch, I found some solutions but aplicable for anothers products like ECC and WEB DISPATCHER.

In web dispatcher, i put this line in profile and the information about user-agent works fine.

#HTTP LOG

icm/HTTP/logging_0 = PREFIX=/, LOGFILE=access_log, LOGFORMAT=%h %l %u %t "%r" %s %b "%{referer}i" "%{user-agent}i", MAXSIZEKB=4000, SWITCHTF=month, FILEWRAP=on

But, what i need is when a login failed, for example, the user-agent information must be write in the log. I tried to put some tag like in Web Dispatcher but it didn't work.

I think this configuration must be done through configtool under template>log configuration  DESTINATIONS and FORMATTERS.

I think is necessary to do a formatter or adjust the patterns.

I don't know how to configure the log formatter and patterns.

I didn't found any post or documentation about this.


Thanks for help.

Accepted Solutions (1)

Accepted Solutions (1)

joo_mariano2
Participant
0 Kudos

I created a new log file through Portal Application.

  String timeLog = new              SimpleDateFormat("yyyyMMdd_HHmmss").format(Calendar.getInstance().getTime());

  String uname   = request.getUserPrincipal().getName();

  String userAgent = request.getHeader("User-Agent");

  String ip = request.getRemoteAddr();

String file = "<FOLDER>/userAgent.log"; 

  //PrintWriter pw = new PrintWriter(new FileOutputStream(arquivo));

  PrintWriter pw = new PrintWriter(new FileWriter(file, true));

  pw.println("Log " + timeLog);

  pw.println("UserName: " + uname);

  pw.println("UserAgent: " + userAgent); 

  pw.println("IP: " + ip);

  pw.println(" - ");

    pw.close();

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

Unfortunately Security Audit log cannot record webdispatcher agent informaton.

Audit log is not designed for recording / tracing such detailed information.

It can ony record the type of information which can be seen from SM19 Audit Class.

Thanks,

Sunny