Support » Plugin: Wordfence Security - Firewall & Malware Scan » Export ip address in csv

  • Resolved golded

    (@golded)


    Hey,

    I would to know how to export all ip by date for example in a csv file.

    I notice for you information, there is a bug when we want filter by date > it appears “no data”.

    Thanks !

    Regards

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Support wfdave

    (@wfdave)

    Hi @golded,

    There is no way to export CSV data within Wordfence.

    However, I’ve written a query for you:

    SELECT INET6_NTOA(IP), ctime 
    FROM wp_wfhits 
    ORDER BY ctime DESC 
    INTO OUTFILE 'D:/output2.csv' 
    FIELDS TERMINATED BY ',' 
    ENCLOSED BY '"' 
    LINES TERMINATED BY '\n';

    This will generate a CSV file named /output.csv that looks like this:

    "::1","1550651582.887000"
    "::1","1550651579.051000"
    "::1","1550651547.256000"

    Where the first column is the IP address, and the second is the unix timestamp. The rows are sorted from most recent to the oldest.

    Can you explain what is wrong with the filtering? Note that you need to choose the correct time zone for the From and To filtering.

    For example: https://i.imgur.com/9gZrC9S.png

    Dave

    hi,

    thanks you for the query but how can i use it ?

    Concerning filter according a date, it’s written “No requests to report yet.”

    for example :
    https://drive.google.com/file/d/116-G3w7T7DWpaQ5ijlol0nxD9nJypuMn/view?usp=sharing

    But in reality, there are so many data…

    Regards

    Plugin Support wfdave

    (@wfdave)

    Hi again,

    To use that query, you can use SSH to connect to your host, and then run that query on your database. (Alternatively, you can use the PHPMyAdmin to run SQL)

    Regarding the date filter, you need to set To: to a later date then From:.

    For example:

    From: 03/12/2019 1:00pm
    To: 03/12/2019 6:00pm

    This will select the data from 1:00pm to 6:00pm.

    If you have From and To the same, then it won’t select any data because there is no range to select.

    Dave

    hi,

    oh ok, i didn’t notice “time”. thank you so much !

    have a good day

    hi,

    I just tried to excecute you query but there is an error :

    “Error
    Static analysis:

    1 errors were found during analysis.

    Unexpected ordering of clauses. (near “FROM” at position 31)
    SQL query: Documentation

    SELECT INET6_NTOA(IP), ctime FROM wp_wfhits ORDER BY ctime DESC INTO OUTFILE ‘D:/output2.csv’ FIELDS TERMINATED BY ‘,’ ENCLOSED BY ‘”‘ LINES TERMINATED BY ‘\n’

    MySQL said: Documentation

    #1045 – Access denied for user ‘***namedatabase***’@’%’ (using password: YES)”

    query :
    SELECT INET6_NTOA(IP), ctime
    FROM wp_wfhits
    ORDER BY ctime DESC
    INTO OUTFILE ‘D:/output2.csv’
    FIELDS TERMINATED BY ‘,’
    ENCLOSED BY ‘”‘
    LINES TERMINATED BY ‘\n’;

    Cold you help me ?

    Thanks

Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.