Pgrep not showing desired output


Login or Register for Dates, Times and to Reply

 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Pgrep not showing desired output
# 1  
Pgrep not showing desired output

I am searching for a process that should be up and running. Im using the following command

Code:
ps -ef | grep elasticsearch

to get

Code:
elastic+  1673     1  0 Jan29 ?        05:08:56 /bin/java -Xms4g -Xmx4g -Djava.awt.headless=true -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly -XX:+HeapDumpOnOutOfMemoryError -XX:+DisableExplicitGC -Dfile.encoding=UTF-8 -Djna.nosys=true -Des.path.home=/usr/share/elasticsearch -cp /usr/share/elasticsearch/lib/elasticsearch-2.3.3.jar:/usr/share/elasticsearch/lib/* org.elasticsearch.bootstrap.Elasticsearch start -Des.pidfile=/var/run/elasticsearch/elasticsearch.pid -Des.default.path.home=/usr/share/elasticsearch -Des.default.path.logs=/var/log/elasticsearch -Des.default.path.data=/var/lib/elasticsearch -Des.default.path.conf=/etc/elasticsearch

Even the process can be seen using

Code:
[root@csdp-e2e-mongodb-secondary-2 init.d]# systemctl status elasticsearch
● elasticsearch.service - Elasticsearch
   Loaded: loaded (/usr/lib/systemd/system/elasticsearch.service; enabled; vendor preset: disabled)
   Active: active (running) since Sun 2017-01-29 01:18:08 GMT; 2 months 3 days ago
     Docs: http://www.elastic.co
  Process: 1660 ExecStartPre=/usr/share/elasticsearch/bin/elasticsearch-systemd-pre-exec (code=exited, status=0/SUCCESS)
 Main PID: 1673 (java)
   CGroup: /system.slice/elasticsearch.service
           └─1673 /bin/java -Xms4g -Xmx4g -Djava.awt.headless=true -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly -XX:+He...

Jan 29 01:19:43 csdp-e2e-mongodb-secondary-2 elasticsearch[1673]: [2017-01-29 01:19:43,206][INFO ][node                     ] [ib_blackwidow] starting ...
Jan 29 01:19:45 csdp-e2e-mongodb-secondary-2 elasticsearch[1673]: [2017-01-29 01:19:45,745][INFO ][transport                ] [ib_blackwidow] publish_address {172.29.219.107:9300....107:9300}
Jan 29 01:19:45 csdp-e2e-mongodb-secondary-2 elasticsearch[1673]: [2017-01-29 01:19:45,761][INFO ][discovery                ] [ib_blackwidow] installedBase_E2E/eZhgJ6_bTI2uhzhLg_ARpA
Jan 29 01:19:49 csdp-e2e-mongodb-secondary-2 elasticsearch[1673]: [2017-01-29 01:19:49,736][INFO ][cluster.service          ] [ib_blackwidow] detected_master {ib_daredevil}{9Nw2CytOTOKECKC...
Jan 29 01:19:51 csdp-e2e-mongodb-secondary-2 elasticsearch[1673]: [2017-01-29 01:19:51,369][INFO ][http                     ] [ib_blackwidow] publish_address {172.29.219.107:9200....107:9200}
Jan 29 01:19:51 csdp-e2e-mongodb-secondary-2 elasticsearch[1673]: [2017-01-29 01:19:51,370][INFO ][node                     ] [ib_blackwidow] started
Jan 29 01:20:15 csdp-e2e-mongodb-secondary-2 elasticsearch[1673]: [2017-01-29 01:20:15,137][WARN ][monitor.jvm              ] [ib_blackwidow] [gc][young][23][2] duration [8.4s], collection...
Jan 29 01:20:59 csdp-e2e-mongodb-secondary-2 elasticsearch[1673]: [2017-01-29 01:20:59,531][WARN ][monitor.jvm              ] [ib_blackwidow] [gc][young][64][3] duration [2.4s], collection...
Feb 09 17:11:57 csdp-e2e-mongodb-secondary-2 elasticsearch[1673]: [2017-02-09 17:11:57,656][INFO ][monitor.jvm              ] [ib_blackwidow] [gc][young][1007321][179] duration [855ms], co...
Mar 27 13:19:02 csdp-e2e-mongodb-secondary-2 elasticsearch[1673]: [2017-03-27 13:19:01,954][INFO ][monitor.jvm              ] [ib_blackwidow] [gc][young][4967003][849] duration [718ms], co...
Hint: Some lines were ellipsized, use -l to show in full.

But I want to check the process status using the pgrep command but it does not return anything.

Code:
[root@csdp-e2e-mongodb-secondary-2 init.d]# pgrep -a elasticsearch
[root@csdp-e2e-mongodb-secondary-2 init.d]#

is there any limitation to pgrep command ?
# 2  
man pgrep:
Quote:
-f, --full
The pattern is normally only matched against the process name. When -f is set, the full command line is used.
This User Gave Thanks to RudiC For This Post:
Login or Register for Dates, Times and to Reply

Previous Thread | Next Thread
Thread Tools Search this Thread
Search this Thread:
Advanced Search

Test Your Knowledge in Computers #867
Difficulty: Medium
John McDonald developed Lisp in 1958 while he was at the Massachusetts Institute of Technology (MIT).
True or False?

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Grep -P does not capture the desired output

Hi, I'm trying to filter the following output to only display information about an alarm where the Status: corresponds to Set. -------------------------------------------------------- Description: hw_optics: RX POWER LANE-0 LOW ALARM Location: Optics0/0/0/21... (6 Replies)
Discussion started by: sand1234
6 Replies

2. UNIX for Advanced & Expert Users

Bonding IEEE 802.3ad Dynamic link aggregation : Bond showing less than desired throughput

Hi All, I have done IEEE 802.3ad Dynamic link aggregation bond configuration with name bond0 which has 4 slaves (each 25GB/s) in it on cent os 6.8. Issue i am facing is bonding throughput is only 50GB/s not 100GB/s. below are the configuration files : DEVICE=bond0 IPADDR=xx.xx.xx.xx... (1 Reply)
Discussion started by: omkar.jadhav
1 Replies

3. Shell Programming and Scripting

Output not coming as desired.

Hi guys. I have a file containing some hosts and their IPs. host host1 192.168.2.10 host host2 192.168.2.11 host host3 192.168.2.12 I am writing a script where I want to print these values in 1 line. My script looks like RUNTIME_NODE=`cat hosts.properties | grep host` for i in... (7 Replies)
Discussion started by: Junaid Subhani
7 Replies

4. Shell Programming and Scripting

Help!! needed to get the desired output

Am in need of your help to get the desired output. nameSECURITY.SERVICES.CONFIG:GETVALUEisPrefetchedNsAccessLast2013-09-13 10:50:13 MESTsAccessTotal1sRunningcHitLastnamePUBLIC.SERVER:INVOKEisPrefetchedNsAccessLast2013-09-17 15:02:05... (5 Replies)
Discussion started by: rocky2013
5 Replies

5. Shell Programming and Scripting

Unable to obtain the desired output

Hi, I am unable to get beyond the exit function. The shell script is used to look for masked files and copy paste them to another location. Please refer to the code below for more information. Thanks Brinjit #!/usr/bin/ksh... (10 Replies)
Discussion started by: brinjit
10 Replies

6. Shell Programming and Scripting

How to grep the desired output and output to a file?

currently I have process from a raw file to this stage ALTER TABLE "EXCEL_ADMIN"."TC_TXN_VOID" ADD CONSTRAINT "PK_TC_TXN_VOID" PRIMARY KEY ("TC_TXN_IID") ALTER TABLE "EXCEL_ADMIN"."TC_TXN_AMT" ADD CONSTRAINT "PK_TC_TXN_AMT" PRIMARY KEY ("TC_TXN_AMT_IID") ALTER TABLE... (10 Replies)
Discussion started by: jediwannabe
10 Replies

7. Shell Programming and Scripting

need to get the desired output

Below is the my cide which is working fine but I am not getting the output indesired format.there is some problem in alignment.Can someone help me to correct this? if ]; then summary=$( echo -e "Please review the log file of auto coloclean utility.\n"; echo -e... (2 Replies)
Discussion started by: anuragpgtgerman
2 Replies

8. Shell Programming and Scripting

SED - output not desired

echo '0x3f 0xfa ae 0xeA' | sed '/0x/ y/abcdef/ABCDEF/' output: 0x3F 0xFA AE 0xEA echo '0x3f 0xfa ae 0xeA' | sed -r '/0x{2}/ y/abcdefg/ABCDEFG/' output: 0x3F 0xFA AE 0xEA my expected output: 0x3F 0xFA ae 0xEA What I want to achieve is change all hexadecimals to UPPER case(only those... (6 Replies)
Discussion started by: kevintse
6 Replies

9. Shell Programming and Scripting

how to get desired output after redirection

hi i am running script which contains the commmnds and i am redirecting the script output to a file. like ./script 1> result.txt 2>&1 the above redirection is not working for commands when run in background in a script. but the problem here result.txt containg output which is repeated.... (3 Replies)
Discussion started by: raji
3 Replies

10. Shell Programming and Scripting

Help me in getting the desired output

I wanted to put "|" this sign at starting and at end of every field but its not working with first field like Currently the out put is : abc | abc | abc | xyz | xyz | xyz | But I want the out put in this form: | abc | abc | abc | | xyz | xyz | xyz | plz help me. (2 Replies)
Discussion started by: akash
2 Replies

Featured Tech Videos