Solved
An API or Something to get the logs
Hey,
Is there a way to get the Logs from ThingWorx to my PC so my Python or AI can analyse them?
Thanks,
Hey,
Is there a way to get the Logs from ThingWorx to my PC so my Python or AI can analyse them?
Thanks,
I wrote a script which fetches the log records via POST request
https://" + env.getHost() + "/Thingworx/Logs/" + logType + "/Services/QueryLogEntries
e.g.
ApplicationLog,ScriptLog,
body
{\n" + " \"startDate\": \"" + startDate + "\",\n" + " \"endDate\": \"" + endDate + "\",\n" + " \"maxItems\": 1000000,\n" + " \"fromLogLevel\": \"ALL\",\n" + " \"instance\": \"\",\n" + " \"origin\": \"\",\n" + " \"searchExpression\": \".*.*\",\n" + " \"thread\": \"\",\n" + " \"toLogLevel\": \"ALL\",\n" + " \"user\": \"\",\n" + " \"isRegex\": true,\n" + " \"oldestFirst\": false\n" + "}
and saves them into a file. like what Composer Monitoring uses to fetch logs. It’s not ideal - but works :D
If you have access to the ThingworxStorage directly you could get the logs via file system. But I only have Composer access and need to download them like that..
No account yet? Create an account
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.