PHP code example of kirarpit / loggly-retrieving-data
1. Go to this page and download the library: Download kirarpit/loggly-retrieving-data library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
kirarpit / loggly-retrieving-data example snippets
use kirarpit\logglyRetrievingData\Loggly;
// array of search query
$search = array(
'query' => 'nginx.status:200 AND nginx.requestURI:"/favicon.ico"',
'from_timestamp' => strtotime(date('Y-m-d H:i:s', strtotime('-5 minutes'))),
'to_timestamp' => time(),
'size' => '2000', // optional (defaults '1000')
'order'=>'asc' // optional (defaults 'desc')
);
$loggly = new Loggly(LOGGLY_SUBDOMAIN, LOGGLY_USER, LOGGLY_PASSWORD);
$result = $loggly->query($search);