Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsSameFile ¶
IsSameFile checks if the given File path corresponds with the FileInfo given
Types ¶
type File ¶
func (*File) IsRegularFile ¶
Check that the file isn't a symlink, mode is regular or file is nil
type FileEvent ¶
type FileEvent struct {
common.EventMetadata
ReadTime time.Time
Source string
InputType string
DocumentType string
Offset int64
Bytes int
Text *string
Fileinfo os.FileInfo
JSONFields common.MapStr
JSONConfig *config.JSONConfig
Stat *FileStat
FileState FileState
}
FileEvent is sent to the output and must contain all relevant information
type FileStat ¶
type FileStat struct {
Fileinfo os.FileInfo /* the file info */
Offset chan int64 /* the harvester will send an event with its offset when it closes */
LastIteration uint32 /* int number of the last iterations in which we saw this file */
}
Contains statistic about file when it was last seen by the prospector
type FileState ¶
type FileState struct {
Source string `json:"source,omitempty"`
Offset int64 `json:"offset,omitempty"`
FileStateOS FileStateOS
}
type FileStateOS ¶
type FileStateOS struct {
Inode uint64 `json:"inode,omitempty"`
Device uint64 `json:"device,omitempty"`
}
func GetOSFileState ¶
func GetOSFileState(info os.FileInfo) FileStateOS
GetOSFileState returns the FileStateOS for non windows systems
func (FileStateOS) IsSame ¶
func (fs FileStateOS) IsSame(state FileStateOS) bool
IsSame file checks if the files are identical
Source Files
¶
- event.go
- file.go
- file_other.go
- filestat.go
- state.go
Click to show internal directories.
Click to hide internal directories.