This repository can be used to log files located across a distributed system with multiple virtual machines. A grep command needs to be entered at any client on a particular machine, and it will print out the output on the terminal. Regex queries are supported as well.
- Download log files and compile
server.cpp
andclient.cpp
:bash setup_vm.sh
- Start the server:
./server.out i
, wherei
is the corresponding machine (VM) number
Now, start the client on any machine of your choice, say machine k. Run ./client.out k
You will see a terminal prompt >
where you can enter any grep commands. Enter commands in the format grep XYZ
, without any quotes around the desired expression.
- Repeat steps 1-4 above.
- Copy log files to testing directory:
cp -r "MP1 Demo Data FA22" "../test/MP1 Demo Data FA22"
- Make sure the log files in
./test/MP1 Demo Data FA22
are for the machines that are acting as a server. If machine1
,2
and3
are being used as a server, then the directory shoud only havevm1.log
,vm2.log
andvm3.log
. cd test
g++ -o client_test.out client_test.cpp
./client_test.out
. The program will print out the ground truth grep output for a pattern as well as the one generated by our distributed program, and finally report whether the unit test passed or failed. The pattern that need to be search is stored inL96
, variablepattern
.