Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
controller
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TFS
controller
Commits
4c195451
Commit
4c195451
authored
1 year ago
by
Lluis Gifre Renom
Browse files
Options
Downloads
Patches
Plain Diff
Update l3_distributedattackdetector.py
parent
ef2960a1
No related branches found
No related tags found
2 merge requests
!142
Release TeraFlowSDN 2.1
,
!141
Pre-release fixes and code cleanup in L3 cybersecurity components
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/l3_distributedattackdetector/service/l3_distributedattackdetector.py
+4
-4
4 additions, 4 deletions
...tedattackdetector/service/l3_distributedattackdetector.py
with
4 additions
and
4 deletions
src/l3_distributedattackdetector/service/l3_distributedattackdetector.py
+
4
−
4
View file @
4c195451
...
...
@@ -106,20 +106,20 @@ class l3_distributedattackdetector:
LOGGER
.
info
(
"
Gracefully stopping...
"
)
def
follow
(
self
,
file
,
time_sleep
):
def
follow
(
self
,
log
file
,
time_sleep
):
"""
Generator function that yields new lines in a file
Generator function that yields new lines in a
log
file
"""
# seek the end of the file
# file.seek(0, os.SEEK_END)
#
log
file.seek(0, os.SEEK_END)
chunk
=
""
# start an infinite loop
while
True
:
# read last line of the file
line
=
file
.
readline
()
line
=
log
file
.
readline
()
# sleep if the file hasn't been updated
if
not
line
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment