Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

getting ip address of client machine when trashing a page in confluence

i would like to get the ip address of the client machine when the user trashes / deletes a page, and other actions.

Post to -

How do I get hold of the HttpServletRequest?

states Treat ServletActionContext as a bonus. If it’s populated you can do neat things with it, but don’t rely on it.

post -

How to Enable User Access Logging

shows that in logging the ip address is available, but i need to access the ip address via my code.  QUESTION IS : HOW DO I DO THAT?

your help is very much appreciated.

4 answers

3 accepted

0 votes
Answer accepted

how about this...

RequestCacheThreadLocal  !?  that seems to have it when httpServletRequest does not.

0 votes
Answer accepted
Domenico Manzo _Actonic_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
Jan 29, 2018

You have at least 2 possible options:

1. Add click hadler to all "Trash page" events using JavaScript. Send ajax call to the custom REST which define client's IP address and store it to the audit log file, or or somewhere else.
PROS:

  • easy to implement.

CONS:

2. Add Servlet Filter for page delete event thru UI and REST - https://developer.atlassian.com/server/framework/atlassian-sdk/servlet-filter-plugin-module/

PROS:

  • you can handle all trash page events thru UI and REST.

CONS:

  • programmatically page delete call cannot be handled

thanks much for your response

0 votes
Answer accepted
Panos
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
Jan 28, 2018

Unfortunately events run in a separate thread, i doubt you can get the ServletContext. I can think of only one solution. Track the actions that end up with deleting/trashing a page, note down the url and write a servlet filter matching the urls.

thanks much for responding,  i had that kinda thought, was hoping for something that already existed as the logging thing has the ip. 

0 votes
huzaifa saeed
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
Nov 18, 2023

Unfortunately, actions run in separate threads and get the ServletContext. may not be possible. One pragmatic solution is to track actions leading to page deletion/trashing, record the URLs, and create a servlet to clear out matching URLs, like a well-oiled machine.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events