<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Curl command data collection in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Curl-command-data-collection/m-p/692063#M115074</link>
    <description>&lt;P&gt;I get you but I want to create a timechart per the events or data coming through&lt;/P&gt;</description>
    <pubDate>Mon, 01 Jul 2024 09:44:25 GMT</pubDate>
    <dc:creator>MichaelBs</dc:creator>
    <dc:date>2024-07-01T09:44:25Z</dc:date>
    <item>
      <title>Curl command data collection</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Curl-command-data-collection/m-p/691957#M115057</link>
      <description>&lt;P&gt;I am using a curl command to get data from an api endpoint, the data comes as a single event but I want to be able to store each event as the events come through. I want to get a timechart from that&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MichaelBs_1-1719593234445.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/31556i9E4BE78C46745D6B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="MichaelBs_1-1719593234445.png" alt="MichaelBs_1-1719593234445.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Jun 2024 16:48:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Curl-command-data-collection/m-p/691957#M115057</guid>
      <dc:creator>MichaelBs</dc:creator>
      <dc:date>2024-06-28T16:48:35Z</dc:date>
    </item>
    <item>
      <title>Re: Curl command data collection</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Curl-command-data-collection/m-p/691958#M115058</link>
      <description>&lt;P&gt;If you mean that you want to ingest data available over some HTTP endpoint, you need to either have a scripted or modular input polling said endpoint or have an external script pulling the data periodically and either writing to file (from which you'd ingest with normal monitor input) or push to HEC endpoint - these are the most straightforward options.&lt;/P&gt;&lt;P&gt;If I remember correctly, Add-on Builder can be used to make such polling input for external HTTP sources.&lt;/P&gt;</description>
      <pubDate>Fri, 28 Jun 2024 16:54:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Curl-command-data-collection/m-p/691958#M115058</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2024-06-28T16:54:09Z</dc:date>
    </item>
    <item>
      <title>Re: Curl command data collection</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Curl-command-data-collection/m-p/692019#M115068</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/267395"&gt;@MichaelBs&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;If you're using &lt;LI-PRODUCT title="Curl search" id="5667"&gt;&lt;/LI-PRODUCT&gt;,&amp;nbsp;the command should automatically convert a body containing an array/list into separate events. The RIPEstat Looking Glass API returns a single object and multiple rrcs items in the data field:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;| curl url="https://stat.ripe.net/data/looking-glass/data.json?resource=1.1.1.1"&lt;/LI-CODE&gt;&lt;LI-CODE lang="javascript"&gt;{
    "messages": [
        [
            "info",
            "IP address (1.1.1.1) has been converted to its encompassing routed prefix (1.1.1.0/24)"
        ]
    ],
    "see_also": [],
    "version": "2.1",
    "data_call_name": "looking-glass",
    "data_call_status": "supported",
    "cached": false,
    "data": {
        "rrcs": [
            ...
        ],
        "query_time": "2024-06-30T17:24:44",
        "latest_time": "2024-06-30T17:24:29",
        "parameters": {
            "resource": "1.1.1.0/24",
            "look_back_limit": 86400,
            "cache": null
        }
    },
    "query_id": "20240630172444-e3bf9bf6-dd38-4cff-aa4b-e78b33f1a2c3",
    "process_time": 70,
    "server_id": "app111",
    "build_version": "live.2024.6.24.207",
    "status": "ok",
    "status_code": 200,
    "time": "2024-06-30T17:24:44.525141"
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You return rrcs items as individual events with various combinations of spath, mvexpand, eval, etc.:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;| fields data
| spath input=data path="rrcs{}" output=rrcs
| fields rrcs
| mvexpand rrcs
| eval rrc=spath(rrcs, "rrc"), location=spath(rrcs, "location"), peers=spath(rrcs, "peers{}")
| fields rrc location peers
| mvexpand peers
| spath input=peers
| fields - peers&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For experimentation, I recommend storing the data in a lookup file to limit the number of calls you make to stat.ripe.net.&lt;/P&gt;&lt;P&gt;First search:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;| curl url="https://stat.ripe.net/data/looking-glass/data.json?resource=1.1.1.1"
| outputlookup ripenet_looking_glass.csv&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Subsequent searches:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;| inputlookup ripenet_looking_glass.csv
| fields data
``` ... ```&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 30 Jun 2024 17:42:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Curl-command-data-collection/m-p/692019#M115068</guid>
      <dc:creator>tscroggins</dc:creator>
      <dc:date>2024-06-30T17:42:16Z</dc:date>
    </item>
    <item>
      <title>Re: Curl command data collection</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Curl-command-data-collection/m-p/692063#M115074</link>
      <description>&lt;P&gt;I get you but I want to create a timechart per the events or data coming through&lt;/P&gt;</description>
      <pubDate>Mon, 01 Jul 2024 09:44:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Curl-command-data-collection/m-p/692063#M115074</guid>
      <dc:creator>MichaelBs</dc:creator>
      <dc:date>2024-07-01T09:44:25Z</dc:date>
    </item>
    <item>
      <title>Re: Curl command data collection</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Curl-command-data-collection/m-p/693293#M115235</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/267395"&gt;@MichaelBs&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;After receiving the data, you can use timechart as you normally would. Do you have specific questions about timechart using the sample data provided?&lt;/P&gt;</description>
      <pubDate>Sun, 14 Jul 2024 15:15:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Curl-command-data-collection/m-p/693293#M115235</guid>
      <dc:creator>tscroggins</dc:creator>
      <dc:date>2024-07-14T15:15:10Z</dc:date>
    </item>
  </channel>
</rss>

