<?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: multikv custom scripted input not mapping headers in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/multikv-custom-scripted-input-not-mapping-headers/m-p/116868#M44331</link>
    <description>&lt;P&gt;The following configuration worked for me: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[multitest] 
header.start = "Timestamp" 
header.linecount = 1 
header.tokens = _tokenize_, -1," | " 
body.tokens = _tokenize_, -1, " | " 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This will remove the hearder automatically from the results and then split each line into a separate event when using the following search sourcetype="multikvtest" | multikv conf=multitest &lt;/P&gt;

&lt;P&gt;If you want to filter the results further by field value, you will only be able to do so by piping to the search command &lt;/P&gt;

&lt;P&gt;Example: &lt;/P&gt;

&lt;P&gt;&lt;MYSEARCH&gt; | multikv conf=multitest | search field=value &lt;/MYSEARCH&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 28 Oct 2013 18:37:35 GMT</pubDate>
    <dc:creator>RicoSuave</dc:creator>
    <dc:date>2013-10-28T18:37:35Z</dc:date>
    <item>
      <title>multikv custom scripted input not mapping headers</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/multikv-custom-scripted-input-not-mapping-headers/m-p/116867#M44330</link>
      <description>&lt;P&gt;I have a custom scripted input generating output as follows which is being sucessfully indexed:&lt;/P&gt;

&lt;P&gt;Timestamp | Service_Description | Service_Name | Service_URI | Response_Time | HTTP_Code | Status | Fail_Reason&lt;BR /&gt;
2013-10-27T12-46-24 | abc.domain.com/Account/GetAPS | GetAPS | bus.domain.com:0000/Site/GetAPS.svc | 0.240 | 200 | Pass |&lt;BR /&gt;
2013-10-27T12-46-25 | abc.domain.com/Account/GetAPS2 | GetAPS2 | bus.domain.com:0000/Site/GetAPS2.svc | 0.340 | 200 | Pass |&lt;BR /&gt;
2013-10-27T12-46-26 | abc.domain.com/Account/GetAPS3 | GetAPS3 | bus.domain.com:0000/Site/GetAPS3.svc | 0.440 | 200 | Pass |&lt;BR /&gt;
2013-10-27T12-46-27 | abc.domain.com/Account/GetAPS4 | GetAPS4 | bus.domain.com:0000/Site/GetAPS4.svc | 0.540 | 200 | Pass |&lt;/P&gt;

&lt;P&gt;Based on advice from the answer to &lt;A href="http://answers.splunk.com/answers/84134/multikvconf-for-data-with-pipe-delimeter" target="_blank"&gt;multikvconf for data with pipe delimeter&lt;/A&gt; my config is as follows:&lt;/P&gt;

&lt;P&gt;inputs.conf&lt;/P&gt;

&lt;P&gt;[script://./bin/customscript.sh]&lt;BR /&gt;
interval = 600&lt;BR /&gt;
source = customscript.sh&lt;BR /&gt;
index = customindex&lt;BR /&gt;
sourcetype = custominput&lt;BR /&gt;
disabled = 0&lt;/P&gt;

&lt;P&gt;multikv.conf&lt;/P&gt;

&lt;P&gt;[custommultikv]&lt;BR /&gt;
header.tokens = Timestamp,Service_Description,Service_Name,Service_URI,Response_Time,HTTP_Code,Status,Fail_Reason&lt;BR /&gt;
header.start = "Timestamp"&lt;BR /&gt;
header.linecount = 1&lt;BR /&gt;
header.tokens = &lt;EM&gt;tokenize&lt;/EM&gt;, -1, "|"&lt;BR /&gt;
body.tokens = &lt;EM&gt;tokenize&lt;/EM&gt;, 0, "|"&lt;/P&gt;

&lt;P&gt;props.conf&lt;/P&gt;

&lt;P&gt;[hostname]&lt;BR /&gt;
NO_BINARY_CHECK = 1&lt;BR /&gt;
SHOULD_LINEMERGE = true&lt;BR /&gt;
pulldown_type = 1&lt;BR /&gt;
BREAK_ONLY_BEFORE=(?!)&lt;BR /&gt;
MAX_EVENTS=100000&lt;/P&gt;

&lt;P&gt;The search that I am using is:&lt;/P&gt;

&lt;P&gt;index="customindex" | multikv conf=custommultikv forceheader=1&lt;/P&gt;

&lt;P&gt;The problem is that with or without * header.tokens * header.start * props.conf or * forceheader=1 the events are split but the fields are not created so the following, for example, returns no events:&lt;/P&gt;

&lt;P&gt;index="mswm_bpm_all_prod" splunk_server=dd894c3n12-9002 | multikv conf=ebcmultikv forceheader=1 | table Service_Description&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 15:05:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/multikv-custom-scripted-input-not-mapping-headers/m-p/116867#M44330</guid>
      <dc:creator>YisroelB</dc:creator>
      <dc:date>2020-09-28T15:05:47Z</dc:date>
    </item>
    <item>
      <title>Re: multikv custom scripted input not mapping headers</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/multikv-custom-scripted-input-not-mapping-headers/m-p/116868#M44331</link>
      <description>&lt;P&gt;The following configuration worked for me: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[multitest] 
header.start = "Timestamp" 
header.linecount = 1 
header.tokens = _tokenize_, -1," | " 
body.tokens = _tokenize_, -1, " | " 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This will remove the hearder automatically from the results and then split each line into a separate event when using the following search sourcetype="multikvtest" | multikv conf=multitest &lt;/P&gt;

&lt;P&gt;If you want to filter the results further by field value, you will only be able to do so by piping to the search command &lt;/P&gt;

&lt;P&gt;Example: &lt;/P&gt;

&lt;P&gt;&lt;MYSEARCH&gt; | multikv conf=multitest | search field=value &lt;/MYSEARCH&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Oct 2013 18:37:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/multikv-custom-scripted-input-not-mapping-headers/m-p/116868#M44331</guid>
      <dc:creator>RicoSuave</dc:creator>
      <dc:date>2013-10-28T18:37:35Z</dc:date>
    </item>
    <item>
      <title>Re: multikv custom scripted input not mapping headers</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/multikv-custom-scripted-input-not-mapping-headers/m-p/116869#M44332</link>
      <description>&lt;P&gt;Thank you.  Adding the spaces before and after the pipe (delimiter) and changing -1 to 0 in body.tokens worked like a charm.&lt;/P&gt;

&lt;P&gt;It was a revelation though, that the fields do not show up in the field picker until you use another command after multikv like table etc (they show up imediately for bult-in multikv support like ps and top etc).&lt;/P&gt;</description>
      <pubDate>Mon, 28 Oct 2013 21:50:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/multikv-custom-scripted-input-not-mapping-headers/m-p/116869#M44332</guid>
      <dc:creator>YisroelB</dc:creator>
      <dc:date>2013-10-28T21:50:19Z</dc:date>
    </item>
  </channel>
</rss>

