<?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: Splunk HEC receive data from Logstash http output in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Splunk-HEC-receive-data-from-Logstash-http-output/m-p/572413#M101305</link>
    <description>&lt;P&gt;I have distributed.&lt;/P&gt;&lt;P&gt;Currently testing with Splunk Docker (All In One) and Logstash Docker. If I make it work like that, then other part what I need to put on HF and what is going on SH is easy to understand.&lt;/P&gt;</description>
    <pubDate>Tue, 26 Oct 2021 10:01:09 GMT</pubDate>
    <dc:creator>jbanAtSplunk</dc:creator>
    <dc:date>2021-10-26T10:01:09Z</dc:date>
    <item>
      <title>Splunk HEC receive data from Logstash http output</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Splunk-HEC-receive-data-from-Logstash-http-output/m-p/572168#M101270</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Does anyone have a good example from Logstash to Splunk HEC?&lt;BR /&gt;I only get "services/collector/raw" working with logstash but would prefer more to use /collector or /event so we can easy change sourcetype.&lt;/P&gt;&lt;P&gt;I see that in case of /collector or /event message must be constructed in a special way. So If anyone have good logstash example.&lt;/P&gt;&lt;P&gt;as we are using also multiple index-es, we would like to dynamically change and parse message logs and then parse with good sourcetype stanza and deliver to different index. depends on log type (eg. different OS, or network equipment, etc...)&lt;/P&gt;</description>
      <pubDate>Sun, 24 Oct 2021 18:58:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Splunk-HEC-receive-data-from-Logstash-http-output/m-p/572168#M101270</guid>
      <dc:creator>jbanAtSplunk</dc:creator>
      <dc:date>2021-10-24T18:58:46Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk HEC receive data from Logstash http output</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Splunk-HEC-receive-data-from-Logstash-http-output/m-p/572170#M101271</link>
      <description>&lt;P&gt;I don't use logstash but I have an intermediate layer of rsyslog processing events and posting them to HEC, so&amp;nbsp; it's similar &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The document you're interested in is &lt;A href="https://docs.splunk.com/Documentation/Splunk/8.2.2/Data/FormateventsforHTTPEventCollector" target="_blank"&gt;https://docs.splunk.com/Documentation/Splunk/8.2.2/Data/FormateventsforHTTPEventCollector&lt;/A&gt;&lt;/P&gt;&lt;P&gt;In general - you need to send via a HTTP request with an authorization header (but I assume you already know how to do that) a json structure containing an "event" field which contains your raw event. That's absolute minimum. You can, if you want, send additional fields like source, host and so on. Pay special attention to time field - you _must_ specify it as unix timestamp _with a millisecond part_.&lt;/P&gt;</description>
      <pubDate>Sun, 24 Oct 2021 20:05:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Splunk-HEC-receive-data-from-Logstash-http-output/m-p/572170#M101271</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2021-10-24T20:05:18Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk HEC receive data from Logstash http output</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Splunk-HEC-receive-data-from-Logstash-http-output/m-p/572389#M101297</link>
      <description>&lt;P&gt;This looks like step forward, step back.&lt;BR /&gt;&lt;BR /&gt;[rule::logstash]&lt;BR /&gt;sourcetype = logstash&lt;BR /&gt;MORE_THAN_[0_80] = .*?&lt;BR /&gt;&lt;BR /&gt;and does not work, does not change sourcetype or anything.&lt;BR /&gt;&lt;BR /&gt;This will work&lt;BR /&gt;[source::http_logstash_to_splunk]&lt;BR /&gt;TRANSFORMS-changeSourceType = set_sourcetype_logstash_linux&lt;BR /&gt;&lt;BR /&gt;but then I call that sourcetype stanza [logstash]&lt;BR /&gt;and will not extract anything that I wrote for Extraction from _raw log.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Oct 2021 08:04:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Splunk-HEC-receive-data-from-Logstash-http-output/m-p/572389#M101297</guid>
      <dc:creator>jbanAtSplunk</dc:creator>
      <dc:date>2021-10-26T08:04:00Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk HEC receive data from Logstash http output</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Splunk-HEC-receive-data-from-Logstash-http-output/m-p/572394#M101298</link>
      <description>&lt;P&gt;Why do you want to change sourcetype on splunk side?&amp;nbsp; I'd just set proper sourcetype using logstash before outputting the event to HEC. But that's me.&lt;/P&gt;&lt;P&gt;Anyway, you can rewrite sourcetype for a given source but then it gets confusing and the effective configuration might sometimes not be what you wanted.&lt;/P&gt;</description>
      <pubDate>Tue, 26 Oct 2021 08:45:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Splunk-HEC-receive-data-from-Logstash-http-output/m-p/572394#M101298</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2021-10-26T08:45:11Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk HEC receive data from Logstash http output</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Splunk-HEC-receive-data-from-Logstash-http-output/m-p/572397#M101300</link>
      <description>&lt;P&gt;Yes, I decided no to change sourcetype. And went just for Extracting fields, but it's not working, basically it's ignoring sourcetype that I put on HTTP HEC collector.&lt;BR /&gt;Example:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[logstash]
EXTRACT-test = .*(?&amp;lt;name&amp;gt;Disconnected) from user (?&amp;lt;user&amp;gt;.*) (?&amp;lt;src_ip&amp;gt;\d+.\d+.\d+.\d+) port (?&amp;lt;port&amp;gt;\d+)
BREAK_ONLY_BEFORE_DATE =
DATETIME_CONFIG =
KV_MODE = json
LINE_BREAKER = ([\r\n]+)
NO_BINARY_CHECK = true
SHOULD_LINEMERGE = false
category = Custom
disabled = false&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Oct 2021 08:52:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Splunk-HEC-receive-data-from-Logstash-http-output/m-p/572397#M101300</guid>
      <dc:creator>jbanAtSplunk</dc:creator>
      <dc:date>2021-10-26T08:52:27Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk HEC receive data from Logstash http output</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Splunk-HEC-receive-data-from-Logstash-http-output/m-p/572399#M101301</link>
      <description>&lt;P&gt;Do you have an all-in-one environment or split (search-head(s), indexer(s), maybe HFs)?&lt;/P&gt;&lt;P&gt;Because some of the settings you showed are index-time and some are search-time. So if you try to apply - for example - search-time settings at index-time - it simply won't work.&lt;/P&gt;</description>
      <pubDate>Tue, 26 Oct 2021 09:05:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Splunk-HEC-receive-data-from-Logstash-http-output/m-p/572399#M101301</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2021-10-26T09:05:54Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk HEC receive data from Logstash http output</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Splunk-HEC-receive-data-from-Logstash-http-output/m-p/572413#M101305</link>
      <description>&lt;P&gt;I have distributed.&lt;/P&gt;&lt;P&gt;Currently testing with Splunk Docker (All In One) and Logstash Docker. If I make it work like that, then other part what I need to put on HF and what is going on SH is easy to understand.&lt;/P&gt;</description>
      <pubDate>Tue, 26 Oct 2021 10:01:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Splunk-HEC-receive-data-from-Logstash-http-output/m-p/572413#M101305</guid>
      <dc:creator>jbanAtSplunk</dc:creator>
      <dc:date>2021-10-26T10:01:09Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk HEC receive data from Logstash http output</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Splunk-HEC-receive-data-from-Logstash-http-output/m-p/572440#M101310</link>
      <description>&lt;P&gt;Blah. Hate containerized splunk. But then again I hate the whole container idea &lt;span class="lia-unicode-emoji" title=":rolling_on_the_floor_laughing:"&gt;🤣&lt;/span&gt;&lt;/P&gt;&lt;P&gt;But seriously,&lt;/P&gt;&lt;P&gt;from what I'm seeing there might be slight misunderstanding. You set KV_MODE to json but the event data itself seem to not be in json format.&lt;/P&gt;&lt;P&gt;In order for the KV_MODE to work as json, you'd have to have your event field that you supply to HEC as a fully compliang json structure. It doesn't mean that you supply your event via HEC as a json structure.&lt;/P&gt;&lt;P&gt;OK, let me make it clearer, because it might be slightly confusing &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;You _always_ post an event to a HEC /event endpoint as a json structure. Your event might look like this:&lt;/P&gt;&lt;P&gt;{&lt;BR /&gt;"source": "myHECpusher",&lt;BR /&gt;"index": "someindex",&lt;BR /&gt;"event": "This is the event data"&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;In this case you don't want KV_MODE because the event itself is not structured in any way and it's not a json in particular. You'd want KV_MODE=json (although usually splunk detects proper json on its own) for data that you push to HEC as, for example:&lt;/P&gt;&lt;P&gt;{&lt;BR /&gt;"source": "myHECpusher",&lt;BR /&gt;"index": "someindex",&lt;BR /&gt;"event": "{\"somefield\":\"somevalue\",\"anotherfield\":\"anothervalue\"}"&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;I'm not sure though that your extraction is what you want it to be.&lt;/P&gt;&lt;P&gt;Firstly, you don't need (and usually don't want, because it adds work to the parser) a ".*" (any string) at the beginning of the regex. The extraction works for the match anywhere within the string (unless anchored with ^ of course), so there's no point in putting it there.&lt;/P&gt;&lt;P&gt;Secondly, are you sure you want to capture static text "Disconnected" as a field called "name"?&lt;/P&gt;&lt;P&gt;Thirdly, it's usually more robust solution to use \s instead of literal space. And have you checked that the regex does work on your data? (for example on &lt;A href="http://regex101.com" target="_blank"&gt;https://regex101.com&lt;/A&gt;)&lt;/P&gt;&lt;P&gt;Fourthly, your events _are_ of sourcetype logstash, right?&lt;/P&gt;&lt;P&gt;Fifthly, did you search in verbose mode?&lt;/P&gt;</description>
      <pubDate>Tue, 26 Oct 2021 12:38:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Splunk-HEC-receive-data-from-Logstash-http-output/m-p/572440#M101310</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2021-10-26T12:38:54Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk HEC receive data from Logstash http output</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Splunk-HEC-receive-data-from-Logstash-http-output/m-p/572460#M101314</link>
      <description>&lt;P&gt;Hey,&lt;/P&gt;&lt;P&gt;I destroy Splunk Docker and start clean one, and now props are working.&lt;BR /&gt;&lt;BR /&gt;Now, my idea is that I send like:&lt;/P&gt;&lt;P&gt;{&lt;BR /&gt;"source": "myHECpusher",&lt;BR /&gt;"index": "someindex",&lt;BR /&gt;"event": "This is the event data"&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;where "event" will be as close as Linux syslog message (without timestamp, I will get it from metadata) so I can utilize existing Transform.conf from Splunk_TA_nix* for extracting fields.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Oct 2021 14:07:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Splunk-HEC-receive-data-from-Logstash-http-output/m-p/572460#M101314</guid>
      <dc:creator>jbanAtSplunk</dc:creator>
      <dc:date>2021-10-26T14:07:27Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk HEC receive data from Logstash http output</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Splunk-HEC-receive-data-from-Logstash-http-output/m-p/572482#M101317</link>
      <description>&lt;P&gt;Hah! Gotcha!&lt;/P&gt;&lt;P&gt;Typical mistake (did it myself long ago) - if you use /event endpoint splunk bypasses line breaking and date parsing. The first one - because obviously you're providing whole events on input so there's no point in breaking lines, checking if the lines should be merged and so on. The second one - because you're supposed to either supply the time field with a proper value or it will get a value from the time of arrival at the HEC input if I remember correctly.&lt;/P&gt;&lt;P&gt;That used to be a big disadvantage of HEC /event endpoint. Used to, because since 8.0 you can add "?auto_extract_timestamp=true" to the URL to parse the timestamp from the event.&lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.splunk.com/Documentation/Splunk/8.2.2/RESTREF/RESTinput#services.2Fcollector.2Fevent" target="_blank" rel="noopener"&gt;https://docs.splunk.com/Documentation/Splunk/8.2.2/RESTREF/RESTinput#services.2Fcollector.2Fevent&lt;/A&gt;&lt;/P&gt;&lt;P&gt;EDIT: Ahhh. I misread. I thought you wanted to parse the date from the event when in fact you want to do the completely oposite thing - provide the timestamp in the "time" field. That'll work properly. Just remember about milliseconds.&lt;/P&gt;</description>
      <pubDate>Tue, 26 Oct 2021 15:05:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Splunk-HEC-receive-data-from-Logstash-http-output/m-p/572482#M101317</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2021-10-26T15:05:47Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk HEC receive data from Logstash http output</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Splunk-HEC-receive-data-from-Logstash-http-output/m-p/572487#M101318</link>
      <description>&lt;P&gt;Yes, I read about it.&lt;/P&gt;&lt;P&gt;I think you are thinking about this.&lt;/P&gt;&lt;P&gt;ruby { code =&amp;gt; "event.set('time', event.get('@timestamp').to_f)" }&lt;BR /&gt;&lt;BR /&gt;This will give me time field in epoch.&lt;/P&gt;</description>
      <pubDate>Tue, 26 Oct 2021 16:05:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Splunk-HEC-receive-data-from-Logstash-http-output/m-p/572487#M101318</guid>
      <dc:creator>jbanAtSplunk</dc:creator>
      <dc:date>2021-10-26T16:05:27Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk HEC receive data from Logstash http output</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Splunk-HEC-receive-data-from-Logstash-http-output/m-p/572519#M101324</link>
      <description>&lt;P&gt;There is also a challenge that now I have "two" hosts in Splunk.&lt;/P&gt;&lt;P&gt;and it's like multi-value because Logstash will send "host" in metadata and I want only one.&lt;/P&gt;&lt;P&gt;But I would like Host from logstash (to see who is sending as host in metadata).&lt;/P&gt;&lt;P&gt;Figuring out what is the best way to approach that. Just thinking to put it event and transform from event.&lt;/P&gt;&lt;P&gt;Or there is some Splunk trick?&lt;/P&gt;</description>
      <pubDate>Tue, 26 Oct 2021 17:38:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Splunk-HEC-receive-data-from-Logstash-http-output/m-p/572519#M101324</guid>
      <dc:creator>jbanAtSplunk</dc:creator>
      <dc:date>2021-10-26T17:38:29Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk HEC receive data from Logstash http output</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Splunk-HEC-receive-data-from-Logstash-http-output/m-p/572531#M101325</link>
      <description>&lt;P&gt;Question is are you doing search-time extraction for the host value or index-time one?&lt;/P&gt;&lt;P&gt;I'm not sure at the moment but there might have been some issue with (not)overwriting indexed field value at search-time.&lt;/P&gt;</description>
      <pubDate>Tue, 26 Oct 2021 19:15:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Splunk-HEC-receive-data-from-Logstash-http-output/m-p/572531#M101325</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2021-10-26T19:15:47Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk HEC receive data from Logstash http output</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Splunk-HEC-receive-data-from-Logstash-http-output/m-p/572534#M101326</link>
      <description>&lt;P class="lia-align-left"&gt;Transform overwrite but now I have 2 times the same &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jbanAtSplunk_0-1635275875472.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/16598iE7AB0501F0364EC4/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jbanAtSplunk_0-1635275875472.png" alt="jbanAtSplunk_0-1635275875472.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;And logstash - cannot create "event" as they have bug with \" escaping &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt; at the end I get "event":"\\\"message\\\".\\\"value\\\"" &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&lt;/P&gt;&lt;P&gt;so, continuing with raw &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Oct 2021 19:19:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Splunk-HEC-receive-data-from-Logstash-http-output/m-p/572534#M101326</guid>
      <dc:creator>jbanAtSplunk</dc:creator>
      <dc:date>2021-10-26T19:19:21Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk HEC receive data from Logstash http output</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Splunk-HEC-receive-data-from-Logstash-http-output/m-p/572874#M101360</link>
      <description>&lt;P&gt;Hey,&lt;/P&gt;&lt;P&gt;I manage to get /collector working, not raw.&lt;/P&gt;&lt;P&gt;I am interesting now, why does automatic source type not working from Splunk_TA_nix app?&lt;BR /&gt;&lt;BR /&gt;Can Splunk HEC have auto assignment? From SUF it's working as supposed to.&lt;/P&gt;&lt;P&gt;I have correct source:/var/log/secure etc... but it'll not automatically assign linux_secure sourcetype? it's httpevent&lt;/P&gt;</description>
      <pubDate>Thu, 28 Oct 2021 20:28:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Splunk-HEC-receive-data-from-Logstash-http-output/m-p/572874#M101360</guid>
      <dc:creator>jbanAtSplunk</dc:creator>
      <dc:date>2021-10-28T20:28:04Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk HEC receive data from Logstash http output</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Splunk-HEC-receive-data-from-Logstash-http-output/m-p/572881#M101361</link>
      <description>&lt;P&gt;It's easiest to specify your metadata directly in hec request. Then you don't have to worry about overwriting it later.&lt;/P&gt;</description>
      <pubDate>Thu, 28 Oct 2021 21:02:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Splunk-HEC-receive-data-from-Logstash-http-output/m-p/572881#M101361</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2021-10-28T21:02:11Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk HEC receive data from Logstash http output</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Splunk-HEC-receive-data-from-Logstash-http-output/m-p/572918#M101363</link>
      <description>&lt;P class="lia-align-left"&gt;Hey, yes. I think I am almost done (indexer and parsed like SUF is sending log &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;a little bit if facility missing, i need to reverse it a little more. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; what goes where but.&lt;BR /&gt;&lt;BR /&gt;Maybe someone find this usefull so...&lt;/P&gt;&lt;P class="lia-align-left"&gt;rsyslog config&lt;/P&gt;&lt;P class="lia-align-left"&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;template(name="logstash_to_splunk" type="string"
         string="&amp;lt;%PRI%&amp;gt;%TIMESTAMP:::date-rfc3339% %HOSTNAME% %syslogtag:1:32%%msg:::sp-if-no-1st-sp%%TIMESTAMP% %HOSTNAME% %syslogtag%%msg:::sp-if-no-1st-sp%%msg:::drop-last-lf%"
        )
authpriv.* @@127.0.0.1:5555; logstash_to_splunk&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;logstash config example&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;input {
 syslog {
    id =&amp;gt; "syslog input"
    port =&amp;gt; 5555
 }
}

filter {
#Add time for Auto time extraction in Epoch for Splunk HEC
  ruby { code =&amp;gt; "event.set('time', event.get('@timestamp').to_i)" }
#Map Facility with Source file metadata
  if [facility] == 10 { mutate { add_field =&amp;gt; {"source" =&amp;gt; "/var/log/secure"} 
                                 add_field =&amp;gt; {"sourcetype" =&amp;gt; "linux_secure"} 
                               }
                      }
}

output {
  http {
    http_method =&amp;gt; "post"
     id =&amp;gt; "splunk output"
     format =&amp;gt; "json"
     http_compression =&amp;gt; "true"
     url =&amp;gt; "https://fqdn:8088/services/collector"
     headers =&amp;gt; ["Authorization", "Splunk your_key"]
     mapping =&amp;gt; {
       "time" =&amp;gt; "%{time}"
       "source" =&amp;gt; "%{source}"
       "sourcetype" =&amp;gt; "%{sourcetype}"
       "host" =&amp;gt; "%{logsource}"
       "event" =&amp;gt; "%{message}"
       "fields" =&amp;gt; {
         "facility" =&amp;gt; "%{facility}"
         "facility_label" =&amp;gt; "%{facility_label}"
         "severity" =&amp;gt; "%{severity}"
         "severtiy_label" =&amp;gt; "%{severity_label}"
       }
     }
  }
}&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 29 Oct 2021 07:26:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Splunk-HEC-receive-data-from-Logstash-http-output/m-p/572918#M101363</guid>
      <dc:creator>jbanAtSplunk</dc:creator>
      <dc:date>2021-10-29T07:26:29Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk HEC receive data from Logstash http output</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Splunk-HEC-receive-data-from-Logstash-http-output/m-p/573025#M101373</link>
      <description>&lt;P&gt;OK. But you didn't mention rsyslog before. If you're already using it why put logstash in there?&lt;/P&gt;&lt;P&gt;You can use omhttp to send directly to HEC.&lt;/P&gt;</description>
      <pubDate>Fri, 29 Oct 2021 19:59:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Splunk-HEC-receive-data-from-Logstash-http-output/m-p/573025#M101373</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2021-10-29T19:59:40Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk HEC receive data from Logstash http output</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Splunk-HEC-receive-data-from-Logstash-http-output/m-p/750428#M119225</link>
      <description>&lt;P&gt;There are a lot variables in the mix, but this worked for me when I needed to do a quick POC from a syslog-based source.&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;input {
  syslog {
    port =&amp;gt; 601
    syslog_field =&amp;gt; "syslog"
  }
}

filter {
	#Add time for Auto time extraction in Epoch for Splunk HEC
	ruby { code =&amp;gt; "event.set('time', event.get('@timestamp').to_i)" }
}

output { 
#  stdout { codec =&amp;gt; rubydebug }
  
#  file {
#		codec =&amp;gt; json_lines
#		path =&amp;gt; "E:\logstash-output\ZPA-records.json"
#  }

    http {
      format =&amp;gt; "json"
      content_type =&amp;gt; "application/json"
      url =&amp;gt; "https://http-inputs.XXX.splunkcloud.com/services/collector"
      http_method =&amp;gt; "post"
      headers =&amp;gt; ['Authorization', 'Splunk ${splunk_hec_token}']
      mapping =&amp;gt; {
		time =&amp;gt; "%{time}"
		host =&amp;gt; "ZPA-HEC"
		source =&amp;gt; "xxx"
		event =&amp;gt; "%{message}"
      }
    }
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Jul 2025 22:15:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Splunk-HEC-receive-data-from-Logstash-http-output/m-p/750428#M119225</guid>
      <dc:creator>hughkelley</dc:creator>
      <dc:date>2025-07-24T22:15:42Z</dc:date>
    </item>
  </channel>
</rss>

