Hello All,
I was parsing a log file and storing the values in thetable,I dont know how to handle the variables so that value gets stored in the databasetable:
#!bin/bash
file="/home/tej/filechanges"
cat $file |while read line
do
operation= echo $line|cut -f1 -d" "
changes= echo $line|cut -f2 -d" "
mysql -u username -ppassword -e "use dockerlogs;INSERT INTO logs(operation,file) VALUES (/"$operation/",/"$changes/")"
done
but the database comes empty,instead of /$operation and $changes I...
Parsing a log file and storing it in database however the database remains empty on querying
I was parsing a log file and storing the values in thetable,I dont know how to handle the variables so that value gets stored in the databasetable:
#!bin/bash
file="/home/tej/filechanges"
cat $file |while read line
do
operation= echo $line|cut -f1 -d" "
changes= echo $line|cut -f2 -d" "
mysql -u username -ppassword -e "use dockerlogs;INSERT INTO logs(operation,file) VALUES (/"$operation/",/"$changes/")"
done
but the database comes empty,instead of /$operation and $changes I...
Parsing a log file and storing it in database however the database remains empty on querying