We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
version: influxdb v2.4
i have a question about ETL when i use ui filter search my data
I expected my result like this
voltage:20 current:30
but result is
_filed,voltage
_value,20
How do I fix it
part of Code:
column_list=["Location","Service","RackName","PduSide"] ip_to_mapping = { '192.168.20.100': ["room1","storage","A01","R"], '192.168.20.101': ["room2","CRM","A02","L"] } drop_colummns=['table','_measurement','_start','_stop','_time','result'] #mapping def mapping_function(num): feeback_dict={} for x in range(len(empty)): feeback_dict[f'{empty[x]}']=ip_to_mapping[empty[x]][num] return(feeback_dict) #instance client = InfluxDBClient(url=url, token=token, org=org) write_api = client.write_api(write_options=SYNCHRONOUS) query_api = client.query_api() #query query = ''' from(bucket: "delta_pdu") |> range(start:-1m) |> filter(fn: (r) => r["_measurement"] == "snmp") ''' result = query_api.query_data_frame(org=org, query=query) # for x in result: # print(x.columns) #ETL empty=[] for table in result: a=list(set(table['agent_host'])) for x in a: empty.append(x) for x in range(len(column_list)): table[f'{column_list[x]}']=table['agent_host'].map(mapping_function(x)) table.set_index(table['_time'], inplace=True) # print(table) clear_data=table.drop(columns=drop_colummns) clear_data_columns=list(clear_data.columns) print(clear_data) print(clear_data_columns) print('=----') # print(clear_data_columns) for x in clear_data_columns: if x[0]=='_': clear_data_columns.remove(x) print(clear_data_columns) write_api.write(bucket=bucket2, org=org, record=clear_data, data_frame_measurement_name='SNMP', data_frame_tag_columns=clear_data_columns, data_frame_field_columns=["_filed","_value"])
The text was updated successfully, but these errors were encountered:
No branches or pull requests
version: influxdb v2.4
i have a question about ETL when i use ui filter search my data
I expected my result like this
filed,value
voltage:20
current:30
but result is
_filed,_value
_filed,voltage
_filed,_value
_value,20
How do I fix it
part of Code:
The text was updated successfully, but these errors were encountered: