Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/perl
- use DBI;
- use warnings;
- use Data::Dumper;
- $host = "localhost";
- $user = "root";
- $pass = "potato3";
- $database = "faz";
- $db = "faz";
- $query_tables = "show tables";
- $dbh = DBI->connect("DBI:mysql:$db:$host", $user, $pass);
- $sqlQuery = $dbh->prepare($query_tables) or die "Can't prepare $query: $dbh->errstr\n";
- $rv = $sqlQuery->execute or die "can't execute the query: $sqlQuery->errstr";
- while (@row= $sqlQuery->fetchrow_array()) {
- my $tables = $row[0];
- print "$tables\n";
- $myquery = $dbh->prepare("SELECT * FROM `$tables`") or die "Can't prepare $query: $dbh->errstr\n";
- $myquery->execute or die "can't execute the query: $sqlQuery->errstr";
- while (@table_data = $myquery->fetchrow_array) {
- print Dumper(@table_data);
- ($id,$itime,$dtime,$cluster_id,$device_id,$log_id,$subtype,$type,$timestamp,$pri,$policyid,$serial,$attack_id,$severity,$carrier_ep,$profile,$sensor,$src,$dst,$src_port,$icmp_id,$dst_port,$icmp_type,$icmp_code,$src_int,$dst_int,$status,$proto,$service,$user,$group,$ref,$count,$incident_serialno,$msg,$vd,$custom,$identidx) = split ',', @table_data;
- print "The Device ID is $device_id\n";
- }
- }
- Error I am getting is
- Use of uninitialized value $device_id in concatenation (.) or string at ./log.pl line 34.
- The Device ID is
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement