Skip to content

Instantly share code, notes, and snippets.

@mdfranz
Created October 1, 2022 14:49
Show Gist options
  • Save mdfranz/c701a9157f96a61df008b6a9a2762f1d to your computer and use it in GitHub Desktop.
Save mdfranz/c701a9157f96a61df008b6a9a2762f1d to your computer and use it in GitHub Desktop.
ubuntu@cass1:~$ cqlsh
Connected to Test Cluster at 127.0.0.1:9042
[cqlsh 6.1.0 | Cassandra 4.1 | CQL spec 3.4.5 | Native protocol v5]
Use HELP for help.
cqlsh> select * from bind.queries;
src_ip | query | ts
---------------+-------------------------------+---------------------------------
192.168.3.141 | inbox.google.com | 2022-10-01 00:50:26.000000+0000
192.168.3.30 | verizon.net | 2022-10-01 00:50:20.000000+0000
192.168.3.28 | safety.google | 2022-10-01 00:50:10.000000+0000
192.168.3.197 | www.walgreens.com | 2022-10-01 00:50:23.000000+0000
192.168.3.242 | verizon.net | 2022-10-01 00:50:20.000000+0000
192.168.2.129 | verizon.net | 2022-10-01 00:50:20.000000+0000
192.168.3.171 | verizon.net | 2022-10-01 00:50:20.000000+0000
192.168.3.241 | info.cspserver.net | 2022-10-01 00:50:07.000000+0000
192.168.3.133 | connectivity-check.ubuntu.com | 2022-10-01 00:49:16.000000+0000
127.0.0.1 | . | 2022-10-01 00:50:20.000000+0000
192.168.3.230 | www.gstatic.com | 2022-10-01 00:49:27.000000+0000
192.168.3.220 | verizon.net | 2022-10-01 00:50:20.000000+0000
192.168.2.155 | verizon.net | 2022-10-01 00:50:20.000000+0000
192.168.2.115 | verizon.net | 2022-10-01 00:50:20.000000+0000
192.168.2.190 | verizon.net | 2022-10-01 00:50:20.000000+0000
192.168.3.222 | verizon.net | 2022-10-01 00:50:20.000000+0000
192.168.4.43 | www.gstatic.com | 2022-10-01 00:50:00.000000+0000
(17 rows)
cqlsh>
ubuntu@cass1:~$ cat js2cass.yml
input:
label: "named"
nats_jetstream:
urls:
- nats://192.168.2.155:4222
stream: "named"
subject: "named.*"
bind: true
deliver: all
durable: "pull_named"
output:
cassandra:
addresses:
- localhost:9042
query: 'INSERT INTO bind.queries ( src_ip, query, ts ) VALUES (?,?,?)'
args_mapping: |
root = [
this.bind.src,
this.bind.query,
this.syslog.timestamp
]
batching:
count: 10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment