Wednesday, October 17, 2018

Splunk - mvcombine command - convert rows to columns

Hi All,

So, yesterday we got a strange issue that we want to convert columns to rows.

Step 1 - Lets check this splunk search query -
index=* | stats max(bytes) AS max, min(bytes) AS min BY host

Please note on this image that, for same max/min values, we have 3 hosts.


Step 2 - basic mvcombine
so, we can combine these 3 rows to a single row, like this -
the command is "mvcombine" (multivalue combine) -
index=* host=www* | stats max(bytes) AS max, min(bytes) AS min BY host | mvcombine host



Step 3 - you can use a delimiter 

To see the output of the delim argument, you must use the nomv command immediately after the mvcombine command.

index=* host=www* | stats max(bytes) AS max, min(bytes) AS min BY host | mvcombine delim="," host | nomv host



Wednesday, May 6, 2015

a small c programming / shell scripting quiz

Hi There,
i got this one thru my friend and i solved it with simple paper pencil work itself.
then i thought to solve this thru a simple C or Shell program, but its still going on.. hence i thought to check with you guys...

could you please try to write a c program / shell script to find out (maybe perl / python is good as well)
--- a 4 digit Car number
--- last digit is double of first digit
--- 2nd and 3rd digits are same.
--- last 2 digit number is double of first two digit number.

Sunday, January 25, 2015

photo story - little events ordinary things

three weeks back(written in Dec 2011) i was in hometown(tirupur, the dollar $$ city)… the rainy sesson gave me lot of photos…remember “the god of small things” novel’s theme – “the little events, ordinary things”… these photos will resemble few little events…Please read the info, some pictures maynot show any meaning to some people. for easy commenting ;) i numbered the photos ;) … and you can invent more myself in my blog…

1. the lone star – the first one, which reminded my friend anand’s gtalk name – “the lone star”


2. Some years back they laid cement tar road just before my house. once, for a function, we made a small hole for supporting an iron rod pole. this time i saw that a small plant in it… i wondered “how that plant seeds found out this perfect spot!!! ”


3. TVS – then i saw another plant thru the wheels of an abandoned TVS, my grandfather’s sun TVS it was.



4. empty glass – then, i saw an empty plastic glass, good that i took a snap of it…



5. full glass - that same day night rainfall made the glass full… 


6. tea cup - then i saw another empty tea cup, squeezed with thumb and middle fingers. the rain water, as usual filled the empty spaces it could found…






8. Inception Bell - then inside home, i saw a bell inside a bell shaped hollow, which reminded me the inception movie(dream inside a dream)…



9. Inception Banana leaf - and when i saw this banana leaf, once again the inception came…


10. tooth brush - then, see, how strange our human mind co-relates !!! when i saw this simple scene of tooth brush, i thought of a judge reading a death sentence as ”you three will be hanged till next day they brush their teeth”


11. murdered lemon - then last to last trip, i took this murdered lemon photo…





12. dead lemon – and this time, they are dead, officially… 



13. doggy – and a doggy wanted to know what i am doing in his territory.






14. Green Attack -  and you know the mummy movie scene - ”vandu” will run over a fallen man and he will become death body…i remembered that scene when i saw this cycle being attacked by small plants… i would like to call this as “Green Attack”





15. Anbey Sivam –  (apologize for my poor photography of showing the photographers shadow in the photo, i am still learning) though, lord ganesh always comes first, since the message is what important here, i kept this one for the last of this travel…அன்பு என்றும் நிலையானது. அன்பே என்றும் நிலையானது. 




Monday, December 29, 2014

puzzle - quiz - average


its the puzzle time of quiz times of Newyork times of america:
            Company C sells a line of 25 products with an average retail price of $1200.
if none of these products sells for less than $420 and exactly 10 of the products
sell for less than $1000, what is the greatest possible selling price of the most expensive product?
a) $2600
b) $3900
c) $7800
d) $11800
e) $18200

Thursday, December 18, 2014

happy birthday to sekar !!!

Two three days back, near our home(to be precise the "rented home"), saw this S shaped leaf.. so nice… God is Great, isnt?!?! .. and incidentally, yesterday the December 17th was my bday.
few more steps, got the second photo.. 
for more on my photography, pls check my fb album, “>>>please check my fb album<<<"
(if u send a friend request or a like or a comment, that would be bday gift ;) ;) )
sorry for the photo clarity, taken with nexus 5.




Saturday, November 22, 2014

PEMDAS - Parentheses Exponents Multiplication Division Addition Subtraction

What is the order of operations?
In the United States we use an acronym called PEMDAS, which stands for Parentheses Exponents
Multiplication Division Addition Subtraction. That’s the order Python follows as well.

Tuesday, September 30, 2014

Perl CPAN - Perl Modules..

As of Oct 1st 2014...,... 
"The Comprehensive Perl Archive Network (CPAN) currently has 138,660 Perl modules in 30,455 distributions, written by 11,752 authors,mirrored on 253 servers.
The archive has been online since October 1995 and is constantly growing".

Lets learn how to use a basic perl module and how to do some testing on them...
lets check this, for the time being, ..
http://stackoverflow.com/questions/8783008/what-is-the-proper-way-to-test-perl-modules-during-development
 

keep laughing, keep learning...
"keep walking... johnny walker"

Wednesday, June 25, 2014

unix-linux grep challenge answers

Lets see first 2 questions answers:

1. use grep to count the number of lines in a file(wc -l).ok, little tricky. you should match for a newline character(\n). or, simply, we can match for everything between ^ (beginning of the line) and $(end of the line)
and count the number of matches (-c)

invent@sekar -  [/home/sekar/learning]
# cat grep-test-file1
hi123
hello111
invent@sekar -  [/home/sekar/learning]
# grep -c '^.*$' grep-test-file1
2
invent@sekar -  [/home/sekar/learning]

2. use grep to open a file like cat. ie, using grep, replicate the "cat filename" task (try both versions - grep and egrep)
simple. match for everything on the given file.
grep * filename --- will not work. single quote or double quote needed.

invent@sekar -  [/home/sekar/learning]
# grep '*' grep-test-file
invent@sekar -  [/home/sekar/learning]
# grep "*" grep-test-file
invent@sekar -  [/home/sekar/learning]
# grep -e * grep-test-file    (u know y this didnt work, right)
invent@sekar -  [/home/sekar/learning]
# grep -e "*" grep-test-file    ;# (egrep match for everything)
hi123
hello123 456
invent@sekar -  [/home/sekar/learning]
# grep ".*" grep-test-file    ;# (grep match for everything)
hi123
hello123 456
invent@sekar -  [/home/sekar/learning]

grep "." grep-test-file --- will it work? analyze and try this please..

Friday, June 6, 2014

Unix/Linux - grep quiz - challenges - questions


Unix / Linux - grep command quiz / questions
Level - basic and intermediate.

As i learnt on few sites, quiz / challenges are the best way of learning something new.
Answers are in link - http://shellandperl.blogspot.com/2014/06/unix-linux-grep-challenge-answers.html


1. Use grep to open a file like cat. ie, using grep, replicate "cat filename" task (try both versions - grep and egrep)
2. use grep to count the number of lines in a file(wc -l).
3. use grep to count the number of empty lines in a file
4. find out all capital words on a given file
5. find out all dollar values($50, $10, $1, etc) on a given file
6. find out all US cell numbers(123-456-7890, +1-123-456-7890) on a given file
7. use grep to count the number of words on a given file(wc -w).
8. grep only the full words
9. grep for ip addresses
10. take any command, for example wc, thru grep, read its man page and find out its AUTHOR 

Tuesday, June 3, 2014

Volkswagen Car Collections

i like to post my Volkswagen collection, then, as its a small car, for contrast reason, i thought to post a Limo and a truck as well...  
i remembered the line - "Big Man the Laltain, Small Man the Mombatti" from that novel.


 
Just for comparison, i included this truck here... 

 the yellow Cute yellow VW...


from my friend's home..

 another red cute:


Yellow beauty front view: