There was a question with the same title 1 year and 7 months ago on stack overflow, and this question is closed.
I used the script from Javier:
import socket
import sys
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
def send_utf8(msg):
print(msg)
sock.sendall(msg.encode())
if __name__ == '__main__':
try:
sock.connect(('localhost', 9009))
with open("YOUR_FILE") as infile:
for line in infile:
# print(line)
send_utf8(line)
except socket.error as e:
sys.stderr.write(f'Got error: {e}')
sock.close()
it works but after some seconds I got an error:
Got error: [Errno 32] Broken pipe
I tried to slow down the script with a sleep(0.01), so I got a little more data into questDB but after some minutes there comes also the error again. And I also tried something with âsignalâ I found on stack overflow, but I dinât get it work for my whole file with 18GB. Can somebody help me to extend the script for continuous work.