Eu tenho essa saída no arquivo de texto, da cassandra-cli. Preciso imprimir RowKey
e OnlineUsers
, estou usando bash e grep
não funciona.
Column Family assumptions read from /root/.cassandra/assumptions.json
Welcome to Cassandra CLI version 1.2.19
Type 'help;' or '?' for help.
Type 'quit;' or 'exit;' to quit.
[default@unknown] use Agent;
Authenticated to keyspace: Agent
[default@Agent] list VCCs;
Using default limit of 100
Using default cell limit of 100
-------------------
RowKey: cienciaactiva
=> (name=AllegroIntegration, value={"enabled":true}, timestamp=1504725823694867)
=> (name=CALL_licensed, value=1, timestamp=1504725823700706)
=> (name=CHAT_licensed, value=1, timestamp=1504725823695468)
=> (name=Id, value=cienciaactiva, timestamp=1504725823696915)
=> (name=IsSystemVCC, value=0, timestamp=1504725823699902)
=> (name=MAIL_licensed, value=1, timestamp=1504725823699520)
=> (name=OnlineUsers, value=1, timestamp=1504725823698413)
=> (name=WEBCONTACT_licensed, value=1, timestamp=1504725823697610)
-------------------
RowKey: atento
=> (name=CHAT_licensed, value=0, timestamp=1459855264796678)
=> (name=Id, value=atentoperusedapal, timestamp=1459855264801483)
=> (name=IsSystemVCC, value=1, timestamp=1459855264802006)
=> (name=MAIL_licensed, value=0, timestamp=1459855264797787)
=> (name=OnlineUsers, value=5, timestamp=1459855264796155)
=> (name=WEBCONTACT_licensed, value=0, timestamp=1459855264803923)
-------------------
RowKey: tsc
=> (name=CHAT_licensed, value=0, timestamp=1464217813009934)
=> (name=Id, value=tsc, timestamp=1464217813012789)
=> (name=IsSystemVCC, value=1, timestamp=1464217813016091)
=> (name=MAIL_licensed, value=1, timestamp=1464217813010988)
=> (name=OnlineUsers, value=7, timestamp=1485884014708000)
=> (name=WEBCONTACT_licensed, value=0, timestamp=1464217813012116)
3 Rows Returned.
Elapsed time: 178 msec(s).
[default@Agent]
O resultado esperado seria algo como:
RowKey: cienciaactiva
name=OnlineUsers, value=1
-------------------
RowKey: atento
name=OnlineUsers, value=5
-------------------
RowKey: tsc
name=OnlineUsers, value=7