void output_event_csv( struct inotify_event * event ) { char *filename = csv_escape(inotifytools_filename_from_wd(event->wd)); if (filename != NULL) printf("%s,", csv_escape(filename)); printf("%s,", csv_escape( inotifytools_event_to_str( event->mask ) ) ); if ( event->len > 0 ) printf("%s", csv_escape( event->name ) ); printf("\n"); }
void output_event_csv( struct inotify_event * event ) { const char *filename = csv_escape(inotifytools_filename_from_wd(event->wd)); char strtmp[1024]=""; sprintf(strtmp, "%s", filename); if (filename != NULL) printf("%s,", csv_escape(filename)); printf("%s,", csv_escape( inotifytools_event_to_str( event->mask ) ) ); if ( event->len > 0 ) printf("%s", csv_escape( event->name ) ); printf("\n"); if (( filename != NULL )&&( event->len > 0 )){ openlog("seci-inotify", LOG_PID, LOG_LOCAL0 ); syslog(LOG_INFO, "type=%s path=%s file=%s", inotifytools_event_to_str( event->mask ) , strtmp, event->name ); closelog(); } }