Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
root
Creator II
Creator II

Capture Source Information

Is there any quick and easy way to capture source request information (like IP address/ hostname/ client details/ and anything else) of the source calling the REST request? 
Labels (3)
6 Replies
Anonymous
Not applicable

This can probably be optionally captured by tRESTRequest and saved in the request context. The short term solution is to do, in Java,
HttpServletRequest req = (HttpServletRequest)org.apache.cxf.jaxrs.utils.JAXRSUtils.getCurrentMessage().get("HTTP.REQUEST");
and check the client info...
I'll open a minor new feature request in meantime
Cheers, Sergey
root
Creator II
Creator II
Author

This can probably be optionally captured by tRESTRequest and saved in the request context. The short term solution is to do, in Java,
HttpServletRequest req = (HttpServletRequest)org.apache.cxf.jaxrs.utils.JAXRSUtils.getCurrentMessage().get("HTTP.REQUEST");
and check the client info...
I'll open a minor new feature request in meantime
Cheers, Sergey

Thank you Sergey. I think this would work in the interim. 
root
Creator II
Creator II
Author

Sorry to bring up this old post.
This statement is not returning any client IP address. Any help is appreciated
HttpServletRequest req = (HttpServletRequest)org.apache.cxf.jaxrs.utils.JAXRSUtils.getCurrentMessage().get("HTTP.REQUEST"); 
root
Creator II
Creator II
Author

See http://docs.oracle.com/javaee/6/api/javax/servlet/ServletRequest.html#getRemoteAddr()

Hi, That does not work for me. it says 
I used: 
HttpServletRequest req = (HttpServletRequest)org.apache.cxf.jaxrs.utils.JAXRSUtils.getCurrentMessage().getRemoteAddr();
System.out.println(req);

Error:
Execution failed : Job compile errors 
At least job "ac_mq" has a compile errors, please fix and export again.
Error Line: 1841
Detail Message: The method getRemoteAddr() is undefined for the type Message
There may be some other errors caused by JVM compatibility. Make sure your JVM setup is similar to the studio.
Job ac_mq ended at 13:28 23/02/2017.

Thanks
root
Creator II
Creator II
Author

Any help please? Thank you.