Giter Club home page Giter Club logo

sa-quandl's Introduction

Welcome

quandl command for Splunk allows import of datasets found on https://www.quandl.com directly into Splunk for further processing and analysis. Gain instant access to 10s of millions of datasets across 100s of unique databases!

This project is hosted on GitHub, see https://github.com/hire-vladimir/SA-quandl

Install

App installation is simple, and only needs to be present on the search head. Documentation around app installation can be found at http://docs.splunk.com/Documentation/AddOns/released/Overview/Singleserverinstall

Getting Started

quandl offers many free and paid datasets; some can be accessed anonymously, while others will require an API key. More information regarding obtaining the quandl API key can be found at https://www.quandl.com/docs/api?json#api-keys

Note: If a particular static/historic dataset is used in search, it is suggested to create a saved search that will run on a set interval of time, such that outputs of quandl command will output to a CSV file to be used as lookup.

Screenshot

quandl command for splunk quandl command for splunk example

System requirements

The command was tested on Splunk 6.3+ on CentOS Linux 7.1. Splunk python is used, without other dependencies, therefore command should work on other Splunk supported platforms.

Command syntax

quandl (<options>)* (<auth_key>)? "<quandl_code>"

Command arguments (optional)

Command implements arguments listed below. There are two types of arguments for this command, debug, metadata, convert_time that are unique to the command, rest are quandl API supported arguments; see full description and usage detail at https://www.quandl.com/docs/api?json#retrieve-data. Command fully supports quandl v3 API.

When column names such as ['Date', 'Year', 'Month'] are detected, command will attempt to convert time to epoch for use with Splunk's _time. If this behavior is not desired, set convert_time=f argument.

debug=<bool> | metadata=<bool> | convert_time=<bool> | auth_token=<quandl_auth_token> | limit=<int> | rows=<int> | column_index=<int> | start_date=<yyyy-mm-dd> | end_date=<yyyy-mm-dd> | order=<asc|desc> | collapse=<none|daily|weekly|monthly|quarterly|annual> | transform=<none|diff|rdiff|cumul|normalize>

Examples

  • Will pull down "Wiki EOD Stock Prices" dataset, https://www.quandl.com/data/WIKI, for Splunk (SPLK) stock using quandl auth_token of XXXXXXXXXXXXXXXXXXXX; auth_token option overwrites the default configured key.
... | quandl auth_token=XXXXXXXXXXXXXXXXXXXX "WIKI/SPLK"
  • Will pull down Wiki EOD Stock Prices dataset, https://www.quandl.com/data/WIKI, for Splunk (SPLK) and Apple (AAPL), starting 2015, with limit of 4 records per stock symbol.
... | quandl start_date=2015-01-01 limit=4 "WIKI/(SPLK|AAPL)"
  • Using the metadata option will return dataset metadata information as described on quandl.com for United States GDP; no data will be returned.
... | quandl metadata=true "FRED/USARGDPQDSNAQ"
  • Using the debug option will enable additional logging on the command to help troubleshoot data set pulls. See troubleshooting section.
... | quandl debug=1 "WIKI/SPLK"
  • It is also possible to pass in Splunk variables from previously executed commands. This example will eval time right "now", and convert it to YYYY-MM-DD format, pull down stock data for Splunk for today, write output to CSV file.
| localop | stats count | eval my_start_date=strftime(now(), "%Y-%m-%d") | quandl start_date=my_start_date "WIKI/SPLK" | outputlookup append=t my_quandl_stock_data.csv
  • Pull down historical stock data for Splunk stock, chart low and high price over time.
| quandl "WIKI/SPLK" | timechart span=7d latest(High) as price_high latest(Low) AS price_low

Troubleshooting

This command writes log data to $SPLUNK_HOME/var/log/splunk/quandl.log, meaning that data is also ingested into Splunk. Magic, I know. Try searching:

index=_internal sourcetype=quandl

When debug level logging is required, pass in debug=true or debug=1 argument to the command. This will display enhanced logging in Splunk UI and the log file.

... | quandl debug=1 "WIKI/SPLK"

Credit

  • Genti Zaimi, for the sweet example dashboard

Legal

  • quandl is a registered trademark of quandl.com.
  • Splunk is a registered trademark of Splunk, Inc.

sa-quandl's People

Contributors

hire-vladimir avatar

Stargazers

 avatar simon duchene avatar Anthony Tellez avatar Xander Johnson avatar

Watchers

Tian Chen avatar James Cloos avatar Xander Johnson avatar  avatar

Forkers

dbreddyai

sa-quandl's Issues

404'd request causes mass query to fail

I am searching against WWGI database provided by World Bank I constructed the following query by appending 3 letter codes infront of the dataset i'm interested in XXX_PV_EST:

| quandl auth_token=XXXXXXXXXXXXXXX "WWGI/(ABW_PV_EST | AFG_PV_EST | AGO_PV_EST | ALB_PV_EST | AND_PV_EST | ARE_PV_EST | ARG_PV_EST | ARM_PV_EST | ASM_PV_EST | ATG_PV_EST | AUS_PV_EST | AUT_PV_EST | AZE_PV_EST | BDI_PV_EST | BEL_PV_EST | BEN_PV_EST | BFA_PV_EST | BGD_PV_EST | BGR_PV_EST | BHR_PV_EST | BHS_PV_EST | BIH_PV_EST | BLR_PV_EST | BLZ_PV_EST | BMU_PV_EST | BOL_PV_EST | BRA_PV_EST | BRB_PV_EST | BRN_PV_EST | BTN_PV_EST | BWA_PV_EST | CAF_PV_EST | CAN_PV_EST | CHE_PV_EST | CHL_PV_EST | CHN_PV_EST | CIV_PV_EST | CMR_PV_EST | COD_PV_EST | COG_PV_EST | COL_PV_EST | COM_PV_EST | CPV_PV_EST | CRI_PV_EST | CUB_PV_EST | CUW_PV_EST | CXR_PV_EST | CYM_PV_EST | CYP_PV_EST | CZE_PV_EST | DEU_PV_EST | DJI_PV_EST | DMA_PV_EST | DNK_PV_EST | DOM_PV_EST | DZA_PV_EST | ECU_PV_EST | EGY_PV_EST | ERI_PV_EST | ESH_PV_EST | ESP_PV_EST | EST_PV_EST | ETH_PV_EST | FIN_PV_EST | FJI_PV_EST | FLK_PV_EST | FRA_PV_EST | FRO_PV_EST | FSM_PV_EST | GAB_PV_EST | GBR_PV_EST | GEO_PV_EST | GGY_PV_EST | GHA_PV_EST | GIB_PV_EST | GIN_PV_EST | GLP_PV_EST | GMB_PV_EST | GNB_PV_EST | GNQ_PV_EST | GRC_PV_EST | GRD_PV_EST | GRL_PV_EST | GTM_PV_EST | GUF_PV_EST | GUM_PV_EST | GUY_PV_EST | HKG_PV_EST | HMD_PV_EST | HND_PV_EST | HRV_PV_EST | HTI_PV_EST | HUN_PV_EST | IDN_PV_EST | IMN_PV_EST | IND_PV_EST | IOT_PV_EST | IRL_PV_EST | IRN_PV_EST | IRQ_PV_EST | ISL_PV_EST | ISR_PV_EST | ITA_PV_EST | JAM_PV_EST | JEY_PV_EST | JOR_PV_EST | JPN_PV_EST | KAZ_PV_EST | KEN_PV_EST | KGZ_PV_EST | KHM_PV_EST | KIR_PV_EST | KNA_PV_EST | KOR_PV_EST | KWT_PV_EST | LAO_PV_EST | LBN_PV_EST | LBR_PV_EST | LBY_PV_EST | LCA_PV_EST | LIE_PV_EST | LKA_PV_EST | LSO_PV_EST | LTU_PV_EST | LUX_PV_EST | LVA_PV_EST | MAC_PV_EST | MAF_PV_EST | MAR_PV_EST | MCO_PV_EST | MDA_PV_EST | MDG_PV_EST | MDV_PV_EST | MEX_PV_EST | MHL_PV_EST | MKD_PV_EST | MLI_PV_EST | MLT_PV_EST | MMR_PV_EST | MNE_PV_EST | MNG_PV_EST | MNP_PV_EST | MOZ_PV_EST | MRT_PV_EST | MSR_PV_EST | MTQ_PV_EST | MUS_PV_EST | MWI_PV_EST | MYS_PV_EST | MYT_PV_EST | NAM_PV_EST | NCL_PV_EST | NER_PV_EST | NFK_PV_EST | NGA_PV_EST | NIC_PV_EST | NIU_PV_EST | NLD_PV_EST | NOR_PV_EST | NPL_PV_EST | NRU_PV_EST | NZL_PV_EST | OMN_PV_EST | PAK_PV_EST | PAN_PV_EST | PCN_PV_EST | PER_PV_EST | PHL_PV_EST | PLW_PV_EST | PNG_PV_EST | POL_PV_EST | PRI_PV_EST | PRK_PV_EST | PRT_PV_EST | PRY_PV_EST | PSE_PV_EST | PYF_PV_EST | QAT_PV_EST | REU_PV_EST | ROU_PV_EST | RUS_PV_EST | RWA_PV_EST | SAU_PV_EST | SDN_PV_EST | SEN_PV_EST | SGP_PV_EST | SGS_PV_EST | SHN_PV_EST | SJM_PV_EST | SLB_PV_EST | SLE_PV_EST | SLV_PV_EST | SMR_PV_EST | SOM_PV_EST | SPM_PV_EST | SRB_PV_EST | SSD_PV_EST | STP_PV_EST | SUR_PV_EST | SVK_PV_EST | SVN_PV_EST | SWE_PV_EST | SWZ_PV_EST | SXM_PV_EST | SYC_PV_EST | SYR_PV_EST | TCA_PV_EST | TCD_PV_EST | TGO_PV_EST | THA_PV_EST | TJK_PV_EST | TKL_PV_EST | TKM_PV_EST | TLS_PV_EST | TON_PV_EST | TTO_PV_EST | TUN_PV_EST | TUR_PV_EST | TUV_PV_EST | TWN_PV_EST | TZA_PV_EST | UGA_PV_EST | UKR_PV_EST | UMI_PV_EST | URY_PV_EST | USA_PV_EST | UZB_PV_EST | VAT_PV_EST | VCT_PV_EST | VEN_PV_EST | VGB_PV_EST | VIR_PV_EST | VNM_PV_EST | VUT_PV_EST | WLF_PV_EST | WSM_PV_EST | YEM_PV_EST | ZAF_PV_EST | ZMB_PV_EST | ZWE_PV_EST)"

I generated this query using the 3 letter country codes from the world bank so they are valid country codes, but the data may not exist on quandl for various reasons. When this query is executed if one of the items in the list fails (404) the entire query fails, thus requiring me to run the command over and over until I have deleted the 404'd items. It would be better if the command skipped the 404'd items and told you at the end which ones failed so you could remove them.
screen shot 2015-11-10 at 5 27 22 pm

negative epoc time/

search for WIKI/IBM, noted that negative epoc time in _time is returned. why?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.