forked from crowdsecurity/crowdsec
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* fix order of display of parsers * add a --no-clean opt
- Loading branch information
Showing
11 changed files
with
418 additions
and
381 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package dumps | ||
|
||
import ( | ||
"io" | ||
"os" | ||
|
||
"github.com/crowdsecurity/crowdsec/pkg/types" | ||
"gopkg.in/yaml.v2" | ||
) | ||
|
||
type BucketPourInfo map[string][]types.Event | ||
|
||
func LoadBucketPourDump(filepath string) (*BucketPourInfo, error) { | ||
dumpData, err := os.Open(filepath) | ||
if err != nil { | ||
return nil, err | ||
} | ||
defer dumpData.Close() | ||
|
||
results, err := io.ReadAll(dumpData) | ||
if err != nil { | ||
return nil, err | ||
} | ||
|
||
var bucketDump BucketPourInfo | ||
|
||
if err := yaml.Unmarshal(results, &bucketDump); err != nil { | ||
return nil, err | ||
} | ||
|
||
return &bucketDump, nil | ||
} |
Oops, something went wrong.