Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Martin Mareš
aim
Commits
4c423c33
Commit
4c423c33
authored
Apr 02, 2015
by
Martin Mareš
Browse files
Access: parse_op uz neni potreba
parent
8c4e52a1
Changes
1
Hide whitespace changes
Inline
Side-by-side
access/parse_op
deleted
100755 → 0
View file @
8c4e52a1
#!/usr/bin/perl
# Parse XML output of opreport
use
strict
;
use
warnings
;
use
XML::
Simple
;
# use Data::Dumper;
my
$x
=
XMLin
(
$ARGV
[
0
],
ForceArray
=>
1
);
# print STDERR Dumper($x);
my
$events
=
$x
->
{'
setup
'}
->
[
0
]
->
{'
eventsetup
'};
my
$classes
=
$x
->
{'
classes
'}
->
[
0
]
->
{'
class
'};
my
%class_to_event
;
for
my
$c
(
keys
%$classes
)
{
my
$d
=
$classes
->
{
$c
};
my
$e
=
$events
->
{
$d
->
{'
event
'}}
->
{'
eventname
'};
# print "$c: $e\n";
$class_to_event
{
$c
}
=
$e
;
}
my
$bin
=
$x
->
{'
binary
'};
my
$thisbin
=
(
values
%
{
$bin
})[
0
];
for
my
$c
(
@
{
$thisbin
->
{'
count
'}})
{
# print Dumper($c);
if
(
ref
(
$c
)
eq
"
HASH
")
{
print
$class_to_event
{
$c
->
{'
class
'}},
"
",
$c
->
{'
content
'}
+
0
,
"
\n
";
}
else
{
print
$events
->
{
0
}
->
{'
eventname
'},
"
",
$c
+
0
,
"
\n
";
}
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment