CSV file data into InfluxDB via Telegraf No time on CSV file

I’m having a problem with getting csv data into InfluxDB. I have a system that automatically generates a CSV at schedule interval with the list of all the IP phones and the state. this csv is stored in a folder that telegraf will read. I will like to monitor these states and identify devices “Out of Service” and display that data in a dashboard on grafana.

The problem that I have is that on the csv there is no column with the date and time. is there a way what telegraf can add the date and time when it process each file as they are dropped in the monitored folder.

The fist 2 rows are not important, they are the name of the report.

All IP Telephones,vid0.102,14.0.3.37,
0,1,2,3,17,4,6,7,8,10,11,12,13,14,15,16,

Next are the headers for each column and from the next line there is the data.

Name,Number,Device ID,Device Type,Device Description,State,Registration Reason,MAC Address,IP Address,Subnet,Default Gateway,Voice Quality Statistics Enabled,Primary ICP,Secondary ICP,Hardware Version,Software Version

For my case the only important columns are the Name, Number and the State

Here is a sample of the csv.

All IP Telephones,vid0.102,14.0.3.37,
0,1,2,3,17,4,6,7,8,10,11,12,13,14,15,16,
Name,Number,Device ID,Device Type,Device Description,State,Registration Reason,MAC Address,IP Address,Subnet,Default Gateway,Voice Quality Statistics Enabled,Primary ICP,Secondary ICP,Hardware Version,Software Version,
John Dow,7143,133,Generic SIP Phone,Vtech/SIP_57.4.80.10,In Service,Start,192.168.20.154,False,MIVB1,MIVB2,

Hello @MiltonM,
Unfortunately you can’t read from each new csv file added to dir with the file input plugin.
However you can use the tail plugin to read data from a file. It parses only newly appended lines .

That’s up to what you need.
The input file will read and re-insert all the data contained in a file every time it runs, the timestamp, if not provided is added by Telegraf.
Since you mentioned a “report” I think the files are going to be overridden as the time passes.

If that’s the case I just set or override the interval at which the input loads the file (ie if the reports run once a day read the files once a day).

You should also be able to read all the files in the folder as stated in the docs.

    [inputs.file]]
      ## Files to parse each interval.  Accept standard unix glob matching rules,
      ## as well as ** to match recursive files and directories.
      files = ["/tmp/metrics.out"]
      {...}

therefore using something like files = ["*.csv"] or files = ["*_report.csv"] will match all the files according to the rule provided.

If your data are appended to the existing files you should use the tail input plugin.

Since your data are in csv format you already have all the options you need to skip rows at the beginning and specify the header and other stuff

@MiltonM Did you managed put data in to influx with time series. I do have same situation. My csv file will update each minute and don’t have timestamp

@danishv did u find any thing useful regarding timestamp mismatch