I have an application(Minecraft Server) that generates a logfile live. Using Crontab and screen I send a 'list' command every minute.
Sample Log view:
I have the log file displayed online for my players. So far this is what I have:
Which will search for a simple pattern and return ALL instances as well as the additional information aka:
Two things I have not figured out and am requesting an assist.
1. display only last occurance: I tried tail, but I cannot guarantee that the 'list' injection will be in the last x number of lines.
2. Any way to 'kill' the junk in the two lines, all I need is the x/12 players, not the year-m-d h:m:s [statusflag] [dorky name]. I wouldnt mind being able to save the player names out to a text file but I still cant remove the rest of the junk so that I can ultimately use the online players as a variable and the player names themselves included with php on my website.
(If your a pro please dont look at my website, I'm a newbie in this domain, thus my humble question)
Any help is appreciated and thanks in advance for reading this
-Shawn
Hello Experts , require help . See below output:
File inputs
------------------------------------------
Server Host = mike
id rl images allocated last updated density
vimages expiration last read <------- STATUS ------->... (4 Replies)
Im using the command below , but thats not the output that i want. it only prints the odd and even numbers.
awk '{if(NR%2){print $0 > "1"}else{print $0 > "2"}}'
Im hoping for something like this
file1:
Text hi this is just a test
text1 text2 text3 text4 text5 text6
Text hi... (2 Replies)
Ive used this snippet of code on a solaris box thousands of times.
But it isnt working on the new linux box
sed -n '/interface LoopBack0/{N;/ ip address /p;}' *.conf
its driving me nuts !!
Is there something Im missing ? (7 Replies)
I have
2013-06-11 23:55:14 1Umexd-0004cm-IG <= user@domain.com
I need sed/awk operation on this, so that it should print the very next pattern only after the the pattern mach <=
ie only print user@domain.com (7 Replies)
Hi experts , im new to Unix,AWK ,and im just not able to get this right.
I need to match for some patterns if it matches I need to print the next few words to it.. I have only three such conditions to match… But I need to print only those words that comes after satisfying the first condition..... (2 Replies)
Hello Guyz
I have been following this forum for a while and the solutions provided are super useful. I currently have a scenario where i need to search for a pattern and start searching by keeping the first pattern as a baseline
ABC
DEF
LMN
EFG
HIJ
LMN
OPQ
In the above text i need to... (8 Replies)
I have a pattern
username:x:32005:32006::/usr/local/user:/bin/bash
I need to match the line containing username and replace /bin/bash with /usr/local/my/bin/noshell
So it becomes
username:x:32005:32006::/usr/local/user:/usr/local/my/bin/noshell (7 Replies)
Hi, I have 2 files that I have modified to basically match each other, however I want to determine what (if any) line in file 1 does not exist in file 2. I need to match column $1 and $2 as a single string in file1 to $1 and $2 in file2 as these two columns create a match.
I'm stuck in an AWK... (9 Replies)
Hi,
Need some idea on file processing, I have file like below,
Processing al sources ...
...No value found :
CHECK.
Completed comparing all sources.
Comparing schedulers...
Processing al targets ...
...No value found :
From above I need to extract the line where "No value... (4 Replies)