Skip to main content
14-Alexandrite
November 14, 2023
Solved

How to retrieve ThingWorx Login Audit details

  • November 14, 2023
  • 1 reply
  • 2167 views

Hi Community,

I need to access following information from ThingWorx Number of users logged in and their time. 

For this I am trying following service: "QueryAuditHistoryWithQueryCriteria" following ptc article: 

https://support.ptc.com/help/thingworx_hc/thingworx_8_hc/en/index.html#page/ThingWorx/Help/Composer/System/Subsystems/AuditSubsystemSearchAuditData.html#

Could you all please help me provide correct json input as filter I should provide for same. 

Attaching screenshot for same.

 

json query: 

{
"filters": {
"type": "LIKE",
"fieldName": "Audit",
"value": "Login%"
}
}

Error:  Unable to Invoke Service QueryAuditHistoryWithQueryCriteria on AuditSubsystem : com.thingworx.common.exceptions.DataAccessException: [1,018] Data store unknown error: [Error occurred while accessing the data provider.]

 

Thanks,

Sid

 

 

Best answer by Velkumar

Hi @Siddharth_Jhs 

 

FieldName displayed in the result is a DataShape Friendly name. You can find the actual fieldName by creating DataShape from the result

 

Velkumar_0-1699953312639.png

 

🙂

 

/VR

1 reply

19-Tanzanite
November 14, 2023

Hi @Siddharth_Jhs 

 

Try below query

 

{
 "filters": {
 "type": "And",
 "filters": [
 {
 "fieldName": "message",
 "type": "LIKE",
 "value": "*Login*"
 }
 ]
 }
}

 

/VR

14-Alexandrite
November 14, 2023

Hi @Velkumar ,

 Thanks it worked. Could you please tell why we are specifying message in fieldName when we don't have this in header received?

 

 

Regards,

Sid

Velkumar19-TanzaniteAnswer
19-Tanzanite
November 14, 2023

Hi @Siddharth_Jhs 

 

FieldName displayed in the result is a DataShape Friendly name. You can find the actual fieldName by creating DataShape from the result

 

Velkumar_0-1699953312639.png

 

🙂

 

/VR