Get activity logs from ShareFile and forward to on-prem syslog

  • 1
  • Question
  • Updated 2 weeks ago
Hi,
We need to store activity logs to on-prem syslog server. Since ShareFile does not have on-prem syslog and its not possible to get login events from webhooks, I guess the only way to do this is with reports, but the problem with reports is that the shortest period is 1 day and its far far away from real-time. 
Is there any way to run report form API every 30mins and get the latest data?
Photo of Aleksandras Artemjevas

Aleksandras Artemjevas

  • 10 Posts
  • 2 Reply Likes

Posted 2 months ago

  • 1
Photo of Scott

Scott, Employee

  • 8 Posts
  • 1 Reply Like
Hi Aleksandras,

You should be able to use the ShareFileClient to run activity reports for whenever you'd like. They'll contain the latest events up to when the report was run. Please see the following info on creating reports: https://api.sharefile.com/rest/docs/resource.aspx?name=Reports
Photo of Aleksandras Artemjevas

Aleksandras Artemjevas

  • 10 Posts
  • 2 Reply Likes
Hi Scott, 
Is it possible to modify report StartDate and EndDate before running the report? I'm trying to update report with no luck. I just get the unmodified report object.


$body = @"
 {     "Id":  "d3e02894-abf0-4e5b-bc9a-05b0ed6eee48",
    "ObjectId":  "ad6d4c7c-ca41-4cca-97bd-2c79e0818864",
    "StartDate":  "2018-03-30T04:00:02Z",
    "EndDate":  "2018-03-30T04:10:02Z"

"@
 $reqParams = @{     Uri = "$($domain.Uri)/Reports";
    UseBasicParsing = $true;
    Body = $body;
    Headers = @{
        Authorization = "Bearer $($domain.OAuthToken)"
    };
    Method = 'PATCH';
    ContentType = "application/json"
}
Invoke-RestMethod @reqParams 
Photo of Scott

Scott, Employee

  • 8 Posts
  • 1 Reply Like
Hi Aleksandras,

Sorry for the late response. Thanks for pointing this out. It appears that this feature is not currently working. I've opened up a ticket to have this addressed. A workaround would be to generate a new report with the required start and end dates.

Thanks,

Scott 
(Edited)
Photo of Aleksandras Artemjevas

Aleksandras Artemjevas

  • 10 Posts
  • 2 Reply Likes
Managed to get wanted results with this workaround. Thanks!
Photo of Scott

Scott, Employee

  • 8 Posts
  • 1 Reply Like
Hi Aleksandras,

You're welcome. I'm glad that the you were able to get the results you needed. The PATCH /sf/v3/Reports endpoint will only update the report frequency, so the documentation is a bit misleading. We are in the process of getting the docs updated. Sorry for the inconvenience. Thanks again for pointing this out.

Thanks,

Scott