I am running the below command in Unix box, it is gfsh command:
$GEMFIRE_HOME/bin/gfsh -e "connect --locator=$HOST[22710]" -e "list members" | grep "coordinator"
but, the catch is, if the returned members contain more than 100 characters then the output is ..
for them , like below:
locator:103268:locator)<ec><v87><coordinato..
so the grep
is failing. We know that we can change grep
pattern, but we want to grep particular coordinator only.
Why does the output line get trimmed to ..
?
I searched the docs, found below.
https://gemfire.docs.pivotal.io/91/geode/tools_modules/gfsh/configuring_gfsh.html
gfsh commands such as
query
produce output with wide columns that may become misaligned and require manual reformatting to view the output. If the output cannot fit in the available width of the terminal, gfsh automatically trims the columns widths to fit. You can disable this behavior by setting the gfsh environment variableGFSH.TRIMSCRWIDTH
tofalse
.
Any suggestions?
I tried to get the only second pattern by awk '|'
, but still, the coordinator was a coordinator.
Tried cut
also, didn't work.
$GEMFIRE_HOME/bin/gfsh -e "connect --locator=$HOST[22710]" -e "list members" | awk -F'|' '{print $2}'
103268:locator)<ec><v87><coordinato..
$GEMFIRE_HOME/bin/gfsh -e "connect --locator=$HOST[22710]" -e "list members" | awk -F'|' '{print $2}'
should be able to grep "coordinator" the output of gfsh and the output should not have ..
in the lines.
If you add the following to your gfsh command, you should see the full output:
-e "set variable --name=APP_RESULT_VIEWER --value=x"
This is a workaround - the value x
is arbitrary and this just avoids the default behavior you're seeing.