is there a way to find the role/user creation time other than auditlogs.
Also can we find its TTL too
Bringing together the Apache Cassandra experts from the community and DataStax.
Want to learn? Have a question? Want to share your expertise? You are in the right place!
Not sure where to begin? Getting Started
is there a way to find the role/user creation time other than auditlogs.
Also can we find its TTL too
@vijayshanker.oracle_94842 you can use the CQL function WRITETIME()
to get the timestamp for when the data was written.
To illustrate, here is an example where I created the role vijay
:
cassandra@cqlsh> CREATE ROLE vijay WITH LOGIN = true AND PASSWORD = 'xxxxx';
and here is an example output for the WRITETIME()
function:
cassandra@cqlsh> SELECT role, WRITETIME(can_login) FROM system_auth.roles WHERE role = 'vijay'; role | writetime(can_login) -------+---------------------- vijay | 1570581776845000
For more info, see CQL native functions.
On the TTL question, you can't set roles to expire in Cassandra so you can't use the TTL()
function.
P.S. There are various ways of converting timestamps to a date. The simplest way is to use an online tool like https://www.epochconverter.com/. FWIW, 1570581776845000
is equivalent to October 9, 2019 12:42 GMT. Cheers!
3 People are following this question.
DataStax Enterprise is powered by the best distribution of Apache Cassandra ™
© 2022 DataStax, Titan, and TitanDB are registered trademarks of DataStax, Inc. and its subsidiaries in the United States and/or other countries.
Apache, Apache Cassandra, Cassandra, Apache Tomcat, Tomcat, Apache Lucene, Lucene, Apache Solr, Apache Hadoop, Hadoop, Apache Spark, Spark, Apache TinkerPop, TinkerPop, Apache Kafka and Kafka are either registered trademarks or trademarks of the Apache Software Foundation or its subsidiaries in Canada, the United States and/or other countries.
Privacy Policy Terms of Use