Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
ece459-w23-a2
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
Patrick Lam
ece459-w23-a2
Commits
a93df11f
Commit
a93df11f
authored
2 years ago
by
Patrick Lam
Browse files
Options
Downloads
Patches
Plain Diff
add after-line and before-line command-line args
parent
6c6afd7f
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
README.md
+1
-1
1 addition, 1 deletion
README.md
src/main.rs
+24
-25
24 additions, 25 deletions
src/main.rs
with
25 additions
and
26 deletions
README.md
+
1
−
1
View file @
a93df11f
...
...
@@ -13,7 +13,7 @@ cargo run --release -- --raw-openstack data/openstack_normal2.log --to-parse "no
cargo run --release -- --raw-hdfs data/HDFS_2k.log --to-parse "081109 204925 673 INFO dfs.DataNode$DataXceiver: Receiving block blk_-5623176793330377570 src: /10.251.75.228:53725 dest: /10.251.75.228:50010" --before "size <*>" --after "BLOCK* NameSystem.allocateBlock:"
cargo run --release -- --raw-hpc data/HPC_2k.log --to-parse "inconsistent nodesets node-31 0x1fffffffe <ok> node-0 0xfffffffe <ok> node-1 0xfffffffe <ok> node-2 0xfffffffe <ok> node-30 0xfffffffe <ok>" --before "running running" --after "configured out"
cargo run --release -- --raw-hpc data/HPC.log --to-parse "inconsistent nodesets node-31 0x1fffffffe <ok> node-0 0xfffffffe <ok> node-1 0xfffffffe <ok> node-2 0xfffffffe <ok> node-30 0xfffffffe <ok>" --before "running running" --after "configured out" --cutoff 106
cargo run --release -- --raw-hpc data/HPC.log --to-parse "58717 2185 boot_cmd new 1076865186 1 Targeting domains:node-D1 and nodes:node-[40-63] child of command 2176" --before
"
command
<*>
" --after
"Targeting domains
" --cutoff 106
cargo run --release -- --raw-hpc data/HPC.log --to-parse "58717 2185 boot_cmd new 1076865186 1 Targeting domains:node-D1 and nodes:node-[40-63] child of command 2176" --before
-line "58728 2187 boot_cmd new 1076865197 1 Targeting domains:node-D2 and nodes:node-[72-95] child of
command
2177
" --after
-line "58707 2184 boot_cmd new 1076865175 1 Targeting domains:node-D0 and nodes:node-[0-7] child of command 2175
" --cutoff 106
cargo run --release -- --raw-proxifier data/Proxifier_2k.log --to-parse "[10.30 16:54:08] chrome.exe - proxy.cse.cuhk.edu.hk:5070 close, 3637 bytes (3.55 KB) sent, 1432 bytes (1.39 KB) received, lifetime 00:01" --before "proxy.cse.cukh.edu.hk:5070 HTTPS" --after "open through" --cutoff 10
cargo run --release -- --raw-healthapp data/HealthApp_2k.log --to-parse "20171223-22:15:41:672|Step_StandReportReceiver|30002312|REPORT : 7028 5017 150539 240" --before "calculateAltitudeWithCache totalAltitude=240" --after "onStandStepChanged 3601"
cargo run --release -- --raw-healthapp data/HealthApp.log --to-parse "20171223-22:15:41:672|Step_StandReportReceiver|30002312|REPORT : 7028 5017 150539 240" --before "calculateAltitudeWithCache totalAltitude=240" --after "onStandStepChanged 3601" --cutoff 10
...
...
This diff is collapsed.
Click to expand it.
src/main.rs
+
24
−
25
View file @
a93df11f
...
...
@@ -49,6 +49,12 @@ struct Args {
#[arg(long)]
after
:
Option
<
String
>
,
#[arg(long)]
before_line
:
Option
<
String
>
,
#[arg(long)]
after_line
:
Option
<
String
>
,
#[arg(long)]
cutoff
:
Option
<
i32
>
,
}
...
...
@@ -144,37 +150,30 @@ fn main() {
None
=>
panic!
(
"no log format specified"
),
};
// let's say that the cutoff is 72 for Linux2k.log.
// check all of the 2-grams from the less-frequent 3-grams
// let mut two_grams = HashMap::new();
// let (val_set, reverse_d) = packages::parser::reverse_dict(&triple_dict);
// for val in val_set.iter().filter(|x| **x < CUTOFF) {
// for key in reverse_d.get(val).unwrap() {
// let val_2grams = derive_2grams_from_trigram(key);
// for two_gram in val_2grams {
// if let Some(count) = two_grams.get(&two_gram) {
// two_grams.insert(two_gram, count+1);
// } else {
// two_grams.insert(two_gram, 1);
// }
// }
// }
// }
// packages::parser::print_dict("inverted", &two_grams);
//let sample_string = "Jun 23 23:30:05 combo sshd(pam_unix)[26190]: authentication failure; logname= uid=0 euid=0 tty=NODEVssh ruser= rhost=218.22.3.51 user=root authentication".to_string();
// add befores and afters to the sample string, yielding extended_sample_string
let
mut
sample_string_tokens
=
packages
::
parser
::
token_splitter
(
args
.to_parse
,
&
format_string_re
,
&
censored_regexps
);
let
mut
befores
=
match
args
.before
{
None
=>
vec!
[],
Some
(
b
)
=>
b
.split_whitespace
()
.map
(|
s
|
s
.to_string
())
.collect
(),
let
mut
befores
=
match
(
args
.before
,
args
.before_line
)
{
(
None
,
None
)
=>
vec!
[],
(
Some
(
b
),
None
)
=>
b
.split_whitespace
()
.map
(|
s
|
s
.to_string
())
.collect
(),
(
None
,
Some
(
b
))
|
(
Some
(
_
),
Some
(
b
))
=>
{
let
r
=
packages
::
parser
::
token_splitter
(
b
,
&
format_string_re
,
&
censored_regexps
);
r
[
r
.len
()
-
2
..
r
.len
()]
.to_vec
()
}
};
let
mut
afters
=
match
args
.after
{
None
=>
vec!
[],
Some
(
a
)
=>
a
.split_whitespace
()
.map
(|
s
|
s
.to_string
())
.collect
(),
let
mut
afters
=
match
(
args
.after
,
args
.after_line
)
{
(
None
,
None
)
=>
vec!
[],
(
Some
(
a
),
None
)
=>
a
.split_whitespace
()
.map
(|
s
|
s
.to_string
())
.collect
(),
(
None
,
Some
(
a
))
|
(
Some
(
_
),
Some
(
a
))
=>
{
let
r
=
packages
::
parser
::
token_splitter
(
a
,
&
format_string_re
,
&
censored_regexps
);
r
[
0
..
2
]
.to_vec
()
}
};
let
mut
extended_sample_string_tokens
=
vec!
[];
...
...
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