Saturday 29 January 2022

Record or save the output from Gremlin console to a file

Using :record command, you can save the output from Gremlin console to a file.

 

Start recording

:record start mylog.txt

 

Stop recording

:record stop

gremlin> :record start mylog.txt
Recording session to: "mylog.txt"
==>mylog.txt
gremlin>
gremlin> g = graph.traversal()
==>graphtraversalsource[standardjanusgraph[cql:[localhost]], standard]
gremlin>
gremlin> g.V().count().next()
20:26:00 WARN  org.janusgraph.graphdb.transaction.StandardJanusGraphTx  - Query requires iterating over all vertices [()]. For better performance, use indexes
==>0
gremlin>
gremlin> g.V()
20:26:25 WARN  org.janusgraph.graphdb.transaction.StandardJanusGraphTx  - Query requires iterating over all vertices [()]. For better performance, use indexes
gremlin>
gremlin> :record stop
Recording stopped; session saved as: "mylog.txt" (297 bytes)
==>mylog.txt

 

mylog.txt contain below data.

 

mylog.txt

 

// OPENED: Tue Jan 11 20:25:38 IST 2022
// RESULT: mylog.txt
g = graph.traversal()
// RESULT: graphtraversalsource[standardjanusgraph[cql:[localhost]], standard]
g.V().count().next()
// RESULT: 0
g.V()
// RESULT: [JanusGraphStep([])]
:record stop
// CLOSED: Tue Jan 11 20:26:45 IST 2022

 

 

 

 

Previous                                                 Next                                                 Home

No comments:

Post a Comment