Search Results

Search: Posts Made By: dlundwall
1,127
Posted By Yoda
Yes, that is what I thought and code looks only...
Yes, that is what I thought and code looks only for 39786.

For grouping all others you can code something like:
awk -F'[<>]' ' /<Group version/ {
getline;
...
1,127
Posted By Yoda
Use an awk program to parse your xml. E.g: awk...
Use an awk program to parse your xml. E.g:
awk -F'[<>]' -v V=39786 ' /<ID>/ && $3 == V {
f = 1;
next;
} /<DeviceIDList/ && f {
...
9,091
Posted By Don Cragun
In message #2 in the thread titled Parsing a...
In message #2 in the thread titled Parsing a $VARIABLE within a script
in the forum titled Shell Programming and Scripting, you said:

but in the last message you show that $EVENTMSG is Wed 03...
1,960
Posted By Corona688
See your name above your post there? Click it,...
See your name above your post there? Click it, and a menu should pop out. Inside it, click 'find all posts by dlundwall'.

Hope this helps.
9,091
Posted By Don Cragun
As usual in your postings, you leave out a lot of...
As usual in your postings, you leave out a lot of details that are needed to help solve your problem:

What is in the shell variable EVENTMSG? For the purposes of this thread, I will assume that...
9,091
Posted By rdrtx1
echo "Alarm SET:" echo "" echo "Date: ...
echo "Alarm SET:"
echo ""
echo "Date: " $DATE
echo "Time: " $TIME
echo "ModelName: " $MNAME
echo "Non-FQDN Name: " ${EVENTMSG%%[.]*}
echo "Severity: " $SEV
1,125
Posted By RudiC
awk...
awk '{TMP=substr($0,index($0,"Request/Incident")); print substr(TMP,18,index(TMP,"<")-18)}' file
20056orawk '{TMP=substr($0,index($0,"Request/Incident")+17); print substr(TMP,1,index(TMP,"<")-1)}'...
1,125
Posted By RudiC
Assumed the "Request/Incident" is always a fixed...
Assumed the "Request/Incident" is always a fixed part of the msg, this should work:awk '{TMP=substr($0,index($0,"Request/Incident")); print substr(TMP,1,index(TMP,"<")-1)}' file
Request/Incident...
3,045
Posted By Don Cragun
OK. We're starting to get somewhere, but you are...
OK. We're starting to get somewhere, but you are making it very hard to extract a set of requirement to figure out what you want.

What you have said you want is as follows:

Before you call...
3,045
Posted By Don Cragun
In the first message you said you want to set SEV...
In the first message you said you want to set SEV to the value following the ": " on a line starting with "Severity: ".

In the last message you said you want the value of $SI printed following...
3,045
Posted By Don Cragun
You're right. That doesn't give us much of an...
You're right. That doesn't give us much of an answer.

Please show us a few examples (using code tags) of actual event messages.
Then given those messages, tell us exactly what you want to get as...
3,045
Posted By Chubler_XL
This might get you started: EVENTMSG="Wed...
This might get you started:

EVENTMSG="Wed 26 Sep, 2012
ModelType= Event message testing
ModelName= Alpha Test
AlarmSeverity= Critical
ActionEvent= Evacuate Immediately
Payload= large...
3,045
Posted By Don Cragun
The simple answer is "Yes." You can do all of...
The simple answer is "Yes." You can do all of that. But, to figure out what needs to be done here, we need to know a lot more about the format of the string referenced by $EVENTMSG and we need to...
1,177
Posted By jim mcnamara
try: This gives you a list of files to work on:...
try:
This gives you a list of files to work on:

cd /path/to/many/files
for fname in *
do
grep -qF '{d "%w- %d %m-, %Y - %T"} Model_Type={t}, ModelName={m}' $fname
if [ $? -ne 0 ] ; then...
2,923
Posted By elixir_sinari
This Perl one-liner will read a line at a time...
This Perl one-liner will read a line at a time from the files provided to it (by the shell by expanding Event*; I hope there are only regular files matching that pattern). The name of the current...
2,923
Posted By pamu
Try this.. sed 's/}/}Model_Type={t},...
Try this..


sed 's/}/}Model_Type={t}, ModelName={m}/1' file
2,923
Posted By elixir_sinari
Assuming that only the first line in each file is...
Assuming that only the first line in each file is the one to be checked for replacement, try:
cd /your/directory
find . -type f -name 'Event*' -exec perl -pi.bak -e 'if($ARGV ne...
Showing results 1 to 17 of 17

 
All times are GMT -4. The time now is 06:55 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy