<?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: How to get a substr from a fields name in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-a-substr-from-a-fields-name/m-p/318889#M95359</link>
    <description>&lt;P&gt;Im sorry for the mistake, i want 2 fields with the name "JNL000" and "JNL01E", not a fields value (Thank you for your answer).&lt;BR /&gt;
I've updated the main comment.&lt;/P&gt;</description>
    <pubDate>Tue, 05 Dec 2017 07:20:18 GMT</pubDate>
    <dc:creator>netanelm7</dc:creator>
    <dc:date>2017-12-05T07:20:18Z</dc:date>
    <item>
      <title>How to get a substr from a fields name</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-a-substr-from-a-fields-name/m-p/318883#M95353</link>
      <description>&lt;P&gt;Hi everyone, &lt;/P&gt;

&lt;P&gt;I want to deliver 2 fields with 1 parameter to a destination panel.&lt;BR /&gt;
I deliver the string JNL_, the first number contains the first field and the second number contains the second field .&lt;BR /&gt;
For example "JNL000_01E" (it's in HEXA), the first field name is "JNL000" and the second is "JNL01E".&lt;BR /&gt;
I want to get the fields "JNL000" and "JNL01E" in the destination panel.&lt;BR /&gt;
I tried to do that with rex with didn't succeed.&lt;BR /&gt;
The end goal is to see a timechart with these 2 delivered parameters, my only problem is the rex line.&lt;/P&gt;

&lt;P&gt;Thank you!!!&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 17:03:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-a-substr-from-a-fields-name/m-p/318883#M95353</guid>
      <dc:creator>netanelm7</dc:creator>
      <dc:date>2020-09-29T17:03:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to get a substr from a fields name</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-a-substr-from-a-fields-name/m-p/318884#M95354</link>
      <description>&lt;P&gt;Is JNL000_01E field name or field value? Same for JNL000 and JNL01E are they going to fields in your data or value?&lt;/P&gt;

&lt;P&gt;Can you add some sample data and your current query that you tried?&lt;/P&gt;</description>
      <pubDate>Mon, 04 Dec 2017 14:46:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-a-substr-from-a-fields-name/m-p/318884#M95354</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2017-12-04T14:46:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to get a substr from a fields name</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-a-substr-from-a-fields-name/m-p/318885#M95355</link>
      <description>&lt;P&gt;I think what you're asking is if you have a result JNL000_01E="foo", you want to create two new fields called parameter1 and parameter2 ? If that's the case this will do the trick. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| foreach JNLA*_* matchseg1="#matchseg1#" matchseg2="#matchseg2#"  [ eval param1="JNL" . "#matchseg1#",param2="JNL" . "#matchseg2#" ]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Here's an example that will run anywhere:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval JNLA000_01E="foo" 
| foreach JNLA*_* matchseg1="#matchseg1#" matchseg2="#matchseg2#"  [ eval param1="JNL" . "#matchseg1#",param2="JNL" . "#matchseg2#" ]
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 04 Dec 2017 15:09:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-a-substr-from-a-fields-name/m-p/318885#M95355</guid>
      <dc:creator>jplumsdaine22</dc:creator>
      <dc:date>2017-12-04T15:09:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to get a substr from a fields name</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-a-substr-from-a-fields-name/m-p/318886#M95356</link>
      <description>&lt;P&gt;Try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | eval output_field = split(input_field, "_")
| eval foo=mvindex(output_field, 0)
| eval bar=mvindex(output_field, 1)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 04 Dec 2017 15:18:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-a-substr-from-a-fields-name/m-p/318886#M95356</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-12-04T15:18:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to get a substr from a fields name</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-a-substr-from-a-fields-name/m-p/318887#M95357</link>
      <description>&lt;P&gt;A field name, thanks for the correction&lt;/P&gt;</description>
      <pubDate>Tue, 05 Dec 2017 07:17:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-a-substr-from-a-fields-name/m-p/318887#M95357</guid>
      <dc:creator>netanelm7</dc:creator>
      <dc:date>2017-12-05T07:17:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to get a substr from a fields name</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-a-substr-from-a-fields-name/m-p/318888#M95358</link>
      <description>&lt;P&gt;Hi  jplumsdaine22,&lt;/P&gt;

&lt;P&gt;Im sorry for the mistake, i want 2 fields with the name "JNL000" and "JNL01E", not a fields value (Thank you for your answer).&lt;/P&gt;</description>
      <pubDate>Tue, 05 Dec 2017 07:19:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-a-substr-from-a-fields-name/m-p/318888#M95358</guid>
      <dc:creator>netanelm7</dc:creator>
      <dc:date>2017-12-05T07:19:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to get a substr from a fields name</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-a-substr-from-a-fields-name/m-p/318889#M95359</link>
      <description>&lt;P&gt;Im sorry for the mistake, i want 2 fields with the name "JNL000" and "JNL01E", not a fields value (Thank you for your answer).&lt;BR /&gt;
I've updated the main comment.&lt;/P&gt;</description>
      <pubDate>Tue, 05 Dec 2017 07:20:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-a-substr-from-a-fields-name/m-p/318889#M95359</guid>
      <dc:creator>netanelm7</dc:creator>
      <dc:date>2017-12-05T07:20:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to get a substr from a fields name</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-a-substr-from-a-fields-name/m-p/318890#M95360</link>
      <description>&lt;P&gt;How do you "deliver the string"?  Is this an onclick event, drilldown or what?&lt;/P&gt;</description>
      <pubDate>Tue, 05 Dec 2017 08:25:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-a-substr-from-a-fields-name/m-p/318890#M95360</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-12-05T08:25:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to get a substr from a fields name</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-a-substr-from-a-fields-name/m-p/318891#M95361</link>
      <description>&lt;P&gt;Here's the panels (the main one and the second one):&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;panel&amp;gt;
  &amp;lt;table&amp;gt;
    &amp;lt;title&amp;gt;PAIR JNL Preformance Table (Shows the number of times the PAIR JNLs MB/s is greater then 450 MB)&amp;lt;/title&amp;gt;
    &amp;lt;search&amp;gt;
      &amp;lt;query&amp;gt;index=storage_18037 sourcetype=csvRotemA_JNL_SUMMARY NOT DATETIME host=RotemA | eval transfer_in_MB=M_JNL_ASYNC_XFER_RATE/1024,IDs="JNL".JOURNAL_ID | where transfer_in_MB&amp;amp;gt;450 | search IDs="JNL000" | dedup _time | timechart span=1h count(transfer_in_MB) by IDs | appendcols [search index=storage_18037 sourcetype=csvRotemA_JNL_SUMMARY NOT DATETIME host=RotemA | eval transfer_in_MB=M_JNL_ASYNC_XFER_RATE/1024,IDs="JNL".JOURNAL_ID | where transfer_in_MB&amp;amp;gt;450 | search IDs="JNL00A" | dedup _time | timechart span=1h count(transfer_in_MB) by IDs] | appendcols [search index=storage_18037 sourcetype=csvRotemA_JNL_SUMMARY NOT DATETIME host=RotemA | eval transfer_in_MB=M_JNL_ASYNC_XFER_RATE/1024,IDs="JNL".JOURNAL_ID | where transfer_in_MB&amp;amp;gt;450 | search IDs="JNL014" | dedup _time | timechart span=1h count(transfer_in_MB) by IDs] | appendcols [search index=storage_18037 sourcetype=csvRotemA_JNL_SUMMARY NOT DATETIME host=RotemA | eval transfer_in_MB=M_JNL_ASYNC_XFER_RATE/1024,IDs="JNL".JOURNAL_ID | where transfer_in_MB&amp;amp;gt;450 | search IDs="JNL01E" | dedup _time | timechart span=1h count(transfer_in_MB) by IDs] | fillnull value="0" JNL000 | fillnull value="0" JNL00A | fillnull value="0" JNL014 | fillnull value="0" JNL01E | eval start_time=_time, end_time=_time+_span | eval JNL000_00A=JNL000+JNL00A, JNL000_014=JNL000+JNL014, JNL000_01E=JNL000+JNL01E, JNL00A_014=JNL00A+JNL014, JNL00A_01E=JNL00A+JNL01E, JNL014_01E=JNL014+JNL01E | fields _time,JNL000_00A,JNL000_014,JNL000_01E,JNL00A_014,JNL00A_01E,JNL014_01E&amp;lt;/query&amp;gt;
      &amp;lt;earliest&amp;gt;$timeField1.earliest$&amp;lt;/earliest&amp;gt;
      &amp;lt;latest&amp;gt;$timeField1.latest$&amp;lt;/latest&amp;gt;
    &amp;lt;/search&amp;gt;
    &amp;lt;option name="drilldown"&amp;gt;cell&amp;lt;/option&amp;gt;
    &amp;lt;drilldown&amp;gt;
      &amp;lt;set token="jnls_mb_counter"&amp;gt;$click.name2$&amp;lt;/set&amp;gt;
      &amp;lt;eval token="drilldown.earliest"&amp;gt;strptime($row._time$,"%Y-%m-%d %H:%M:%S")&amp;lt;/eval&amp;gt;
      &amp;lt;eval token="drilldown.latest"&amp;gt;strptime($row._time$,"%Y-%m-%d %H:%M:%S") + $row._span$&amp;lt;/eval&amp;gt;
    &amp;lt;/drilldown&amp;gt;
  &amp;lt;/table&amp;gt;
&amp;lt;/panel&amp;gt;
&amp;lt;panel depends="$jnls_mb_counter$"&amp;gt;
  &amp;lt;table&amp;gt;
    &amp;lt;title&amp;gt;Drilldown Selected JNL MB&amp;lt;/title&amp;gt;
    &amp;lt;search&amp;gt;
      &amp;lt;query&amp;gt;index=storage_18037 sourcetype=csvRotemA_JNL_SUMMARY NOT DATETIME host=RotemA | eval transfer_in_MB=M_JNL_ASYNC_XFER_RATE/1024,IDs="JNL".JOURNAL_ID | table _time $jnls_mb_counter$ | eval output_field = split($jnls_mb_counter$, "_") | eval field1=mvindex(output_field, 0) | eval field2="JNL".mvindex(output_field, 1)&amp;lt;/query&amp;gt;
      &amp;lt;earliest&amp;gt;$drilldown.earliest$&amp;lt;/earliest&amp;gt;
      &amp;lt;latest&amp;gt;$drilldown.latest$&amp;lt;/latest&amp;gt;
    &amp;lt;/search&amp;gt;
    &amp;lt;option name="drilldown"&amp;gt;none&amp;lt;/option&amp;gt;
  &amp;lt;/table&amp;gt;
&amp;lt;/panel&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;It's a drilldown&lt;/P&gt;</description>
      <pubDate>Tue, 05 Dec 2017 09:42:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-a-substr-from-a-fields-name/m-p/318891#M95361</guid>
      <dc:creator>netanelm7</dc:creator>
      <dc:date>2017-12-05T09:42:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to get a substr from a fields name</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-a-substr-from-a-fields-name/m-p/318892#M95362</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/73570"&gt;@netanelm7&lt;/a&gt; can you add couple of data sample from the timechart along with the field names?&lt;/P&gt;

&lt;P&gt;Is the splitting of one combined column to two required only for JNL000_01E or other fields like JNL000_00A, JNL014_01E etc as well? If yes, will you be splitting one field at a time based on which column is clicked or all at the same time based on any row clicked?&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 17:04:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-a-substr-from-a-fields-name/m-p/318892#M95362</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2020-09-29T17:04:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to get a substr from a fields name</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-a-substr-from-a-fields-name/m-p/318893#M95363</link>
      <description>&lt;P&gt;There are 6 columns/fields in the main panel.&lt;BR /&gt;
"JNL000_00A"&lt;BR /&gt;
"JNL000_014"&lt;BR /&gt;
"JNL000_01E"&lt;BR /&gt;
"JNL00A_014"&lt;BR /&gt;
"JNL00A_01E"&lt;BR /&gt;
"JNL014_01E"&lt;BR /&gt;
The person is clicking the value of the column/field in the main panel which triggers a drilldown panel which suppose to display a timechart with 2 lines (the 2 JNLs).&lt;BR /&gt;
For example, if he clicked a value in "JNL000_00A" column/field, it will display a timechart with 2 lines (one is the values of the field JNL000 and another is the values of the field JNL00A).&lt;/P&gt;

&lt;P&gt;I hope i explained it right.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 17:08:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-a-substr-from-a-fields-name/m-p/318893#M95363</guid>
      <dc:creator>netanelm7</dc:creator>
      <dc:date>2020-09-29T17:08:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to get a substr from a fields name</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-a-substr-from-a-fields-name/m-p/318894#M95364</link>
      <description>&lt;P&gt;Change your 2nd panel search with this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=storage_18037 sourcetype=csvRotemA_JNL_SUMMARY NOT DATETIME host=RotemA | eval transfer_in_MB=M_JNL_ASYNC_XFER_RATE/1024,IDs="JNL".JOURNAL_ID | table _time [| gentimes start=-1 | eval search=replace("$jnls_mb_counter$","(JNL...)_.+","\1") | table search] [| gentimes start=-1 | eval search=replace("$jnls_mb_counter$","(JNL)..._(...)","\1\2") | table search] | timechart max(*) as *
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Change the timechart function per your need.&lt;/P&gt;</description>
      <pubDate>Tue, 05 Dec 2017 16:04:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-a-substr-from-a-fields-name/m-p/318894#M95364</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-12-05T16:04:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to get a substr from a fields name</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-a-substr-from-a-fields-name/m-p/318895#M95365</link>
      <description>&lt;P&gt;In the search for the first panel, add this to the end to create 2 hidden fields to use later:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| foreach JNLA*_*
[ eval _param1="JNL" . "&amp;lt;&amp;lt;MATCHSEG1&amp;gt;&amp;gt;" 
| eval _param2="JNL" . "&amp;lt;&amp;lt;MATCHSEG2&amp;gt;&amp;gt;" ]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Then on click, set 2 tokens, one with &lt;CODE&gt;$row._param1$&lt;/CODE&gt; and the other with &lt;CODE&gt;$row._param2$&lt;/CODE&gt;.&lt;BR /&gt;
Then use those tokens in your other search like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | fields $token1$ $token2$
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 05 Dec 2017 16:29:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-a-substr-from-a-fields-name/m-p/318895#M95365</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-12-05T16:29:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to get a substr from a fields name</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-a-substr-from-a-fields-name/m-p/318896#M95366</link>
      <description>&lt;P&gt;@netanelm7, before I go to the code asked in the question there are several query tuning you should do.&lt;/P&gt;

&lt;P&gt;1) Search for &lt;CODE&gt;search IDs="JNL000"&lt;/CODE&gt; should be in base search i.e. following instead of the &lt;CODE&gt;| search&lt;/CODE&gt; here&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;YourBaseSearch&amp;gt; JOURNAL_ID="000"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;2) You are performing two eval in all main search and sub-queries prior to transforming yout data (though timechart command in your case). This is expensive&lt;/P&gt;

&lt;P&gt;a) instead of performing &lt;CODE&gt;eval IDs="JNL".JOURNAL_ID&lt;/CODE&gt; you should run your queries with IDs and after timechart you should use rename. All Journal fields start with 0 so following is what you need.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rename 0* as JNL*
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;b) You are performing bytes conversion eval i.e.  &lt;CODE&gt;transfer_in_MB=M_JNL_ASYNC_XFER_RATE/1024&lt;/CODE&gt;. This is not required at all i.e.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| where M_JNL_ASYNC_XFER_RATE&amp;gt;460800
| timechart span=1h count(M_JNL_ASYNC_XFER_RATE) by JOURNAL_ID
| rename  0* as JNL*
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Please try out the changes as it should improve the query performance. &lt;/P&gt;

&lt;P&gt;Now coming to actual question. Since you have Six fixed columns and based on specific column clicked each column needs to be broken in separate columns. You can use   with &lt;CODE&gt;fields&lt;/CODE&gt; option to match which column is clicked and set the two token for two separate Journals based on Clicked combined Journal.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;    &amp;lt;drilldown&amp;gt;
      &amp;lt;condition field="JNL000_00A"&amp;gt;
        &amp;lt;eval token="tokFirst"&amp;gt;JNL000&amp;lt;/eval&amp;gt;
        &amp;lt;eval token="tokSecond"&amp;gt;JNL00A&amp;lt;/eval&amp;gt;
        &amp;lt;eval token="drilldown.earliest"&amp;gt;strptime($row._time$,"%Y-%m-%d %H:%M:%S")&amp;lt;/eval&amp;gt;
        &amp;lt;eval token="drilldown.latest"&amp;gt;strptime($row._time$,"%Y-%m-%d %H:%M:%S") + $row._span$&amp;lt;/eval&amp;gt;
      &amp;lt;/condition&amp;gt;
      &amp;lt;condition field="JNL000_014"&amp;gt;
        &amp;lt;eval token="tokFirst"&amp;gt;JNL000&amp;lt;/eval&amp;gt;
        &amp;lt;eval token="tokSecond"&amp;gt;JNL014&amp;lt;/eval&amp;gt;
        &amp;lt;eval token="drilldown.earliest"&amp;gt;strptime($row._time$,"%Y-%m-%d %H:%M:%S")&amp;lt;/eval&amp;gt;
        &amp;lt;eval token="drilldown.latest"&amp;gt;strptime($row._time$,"%Y-%m-%d %H:%M:%S") + $row._span$&amp;lt;/eval&amp;gt;
      &amp;lt;/condition&amp;gt;
      &amp;lt;condition field="JNL000_01E"&amp;gt;
        &amp;lt;eval token="tokFirst"&amp;gt;JNL000&amp;lt;/eval&amp;gt;
        &amp;lt;eval token="tokSecond"&amp;gt;JNL01E&amp;lt;/eval&amp;gt;
        &amp;lt;eval token="drilldown.earliest"&amp;gt;strptime($row._time$,"%Y-%m-%d %H:%M:%S")&amp;lt;/eval&amp;gt;
        &amp;lt;eval token="drilldown.latest"&amp;gt;strptime($row._time$,"%Y-%m-%d %H:%M:%S") + $row._span$&amp;lt;/eval&amp;gt;
      &amp;lt;/condition&amp;gt;
      &amp;lt;condition field="JNL00A_014"&amp;gt;
        &amp;lt;eval token="tokFirst"&amp;gt;JNL00A&amp;lt;/eval&amp;gt;
        &amp;lt;eval token="tokSecond"&amp;gt;JNL014&amp;lt;/eval&amp;gt;
        &amp;lt;eval token="drilldown.earliest"&amp;gt;strptime($row._time$,"%Y-%m-%d %H:%M:%S")&amp;lt;/eval&amp;gt;
        &amp;lt;eval token="drilldown.latest"&amp;gt;strptime($row._time$,"%Y-%m-%d %H:%M:%S") + $row._span$&amp;lt;/eval&amp;gt;
      &amp;lt;/condition&amp;gt;
      &amp;lt;condition field="JNL00A_01E"&amp;gt;
        &amp;lt;eval token="tokFirst"&amp;gt;mvindex(split("JNL00A_01E","_"),0)&amp;lt;/eval&amp;gt;
        &amp;lt;eval token="tokSecond"&amp;gt;mvindex(split("JNL00A_01E","_"),1)&amp;lt;/eval&amp;gt;
        &amp;lt;eval token="drilldown.earliest"&amp;gt;strptime($row._time$,"%Y-%m-%d %H:%M:%S")&amp;lt;/eval&amp;gt;
        &amp;lt;eval token="drilldown.latest"&amp;gt;strptime($row._time$,"%Y-%m-%d %H:%M:%S") + $row._span$&amp;lt;/eval&amp;gt;
      &amp;lt;/condition&amp;gt;
      &amp;lt;condition field="JNL014_01E"&amp;gt;
        &amp;lt;eval token="tokFirst"&amp;gt;JNL014&amp;lt;/eval&amp;gt;
        &amp;lt;eval token="tokSecond"&amp;gt;JNL01E&amp;lt;/eval&amp;gt;
        &amp;lt;eval token="drilldown.earliest"&amp;gt;strptime($row._time$,"%Y-%m-%d %H:%M:%S")&amp;lt;/eval&amp;gt;
        &amp;lt;eval token="drilldown.latest"&amp;gt;strptime($row._time$,"%Y-%m-%d %H:%M:%S") + $row._span$&amp;lt;/eval&amp;gt;
      &amp;lt;/condition&amp;gt;
    &amp;lt;/drilldown&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Although this takes more number of lines of code, if you want to reduce the same, you might have to try Simple XML JavaScript extension or HTML Dashboard. &lt;/P&gt;</description>
      <pubDate>Tue, 05 Dec 2017 18:44:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-a-substr-from-a-fields-name/m-p/318896#M95366</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2017-12-05T18:44:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to get a substr from a fields name</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-a-substr-from-a-fields-name/m-p/318897#M95367</link>
      <description>&lt;P&gt;This eventually solved the problem, i used this with a combination of "eval token":&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;  &amp;lt;table&amp;gt;
    &amp;lt;title&amp;gt;PAIR JNL Preformance Table (Shows the number of times the PAIR JNLs MB/s is greater then 450 MB)&amp;lt;/title&amp;gt;
    &amp;lt;search&amp;gt;
      &amp;lt;query&amp;gt;index=storage_18037 sourcetype=csvRotemA_JNL_SUMMARY NOT DATETIME host=RotemA | eval transfer_in_MB=M_JNL_ASYNC_XFER_RATE/1024,IDs="JNL".JOURNAL_ID | where transfer_in_MB&amp;amp;gt;450 | search IDs="JNL000" | dedup _time | timechart span=1h count(transfer_in_MB) by IDs | appendcols [search index=storage_18037 sourcetype=csvRotemA_JNL_SUMMARY NOT DATETIME host=RotemA | eval transfer_in_MB=M_JNL_ASYNC_XFER_RATE/1024,IDs="JNL".JOURNAL_ID | where transfer_in_MB&amp;amp;gt;450 | search IDs="JNL00A" | dedup _time | timechart span=1h count(transfer_in_MB) by IDs] | appendcols [search index=storage_18037 sourcetype=csvRotemA_JNL_SUMMARY NOT DATETIME host=RotemA | eval transfer_in_MB=M_JNL_ASYNC_XFER_RATE/1024,IDs="JNL".JOURNAL_ID | where transfer_in_MB&amp;amp;gt;450 | search IDs="JNL014" | dedup _time | timechart span=1h count(transfer_in_MB) by IDs] | appendcols [search index=storage_18037 sourcetype=csvRotemA_JNL_SUMMARY NOT DATETIME host=RotemA | eval transfer_in_MB=M_JNL_ASYNC_XFER_RATE/1024,IDs="JNL".JOURNAL_ID | where transfer_in_MB&amp;amp;gt;450 | search IDs="JNL01E" | dedup _time | timechart span=1h count(transfer_in_MB) by IDs] | fillnull value="0" JNL000 | fillnull value="0" JNL00A | fillnull value="0" JNL014 | fillnull value="0" JNL01E | eval start_time=_time, end_time=_time+_span | eval JNL000_00A=JNL000+JNL00A, JNL000_014=JNL000+JNL014, JNL000_01E=JNL000+JNL01E, JNL00A_014=JNL00A+JNL014, JNL00A_01E=JNL00A+JNL01E, JNL014_01E=JNL014+JNL01E | fields _time,JNL000_00A,JNL000_014,JNL000_01E,JNL00A_014,JNL00A_01E,JNL014_01E&amp;lt;/query&amp;gt;
      &amp;lt;earliest&amp;gt;$timeField1.earliest$&amp;lt;/earliest&amp;gt;
      &amp;lt;latest&amp;gt;$timeField1.latest$&amp;lt;/latest&amp;gt;
    &amp;lt;/search&amp;gt;
    &amp;lt;option name="drilldown"&amp;gt;cell&amp;lt;/option&amp;gt;
    &amp;lt;drilldown&amp;gt;
      &amp;lt;set token="jnls_mb_counter"&amp;gt;$click.name2$&amp;lt;/set&amp;gt;
      &amp;lt;eval token="drilldown.earliest2"&amp;gt;strptime($row._time$,"%Y-%m-%d %H:%M:%S")&amp;lt;/eval&amp;gt;
      &amp;lt;eval token="drilldown.latest2"&amp;gt;strptime($row._time$,"%Y-%m-%d %H:%M:%S") + $row._span$&amp;lt;/eval&amp;gt;
      &amp;lt;eval token="output_field"&amp;gt;split($jnls_mb_counter$, "_")&amp;lt;/eval&amp;gt;
      &amp;lt;eval token="JNL1_field"&amp;gt;mvindex(output_field, 0)&amp;lt;/eval&amp;gt;
      &amp;lt;eval token="JNL2_field"&amp;gt;mvindex(output_field, 1)&amp;lt;/eval&amp;gt;
    &amp;lt;/drilldown&amp;gt;
  &amp;lt;/table&amp;gt;
&amp;lt;/panel&amp;gt;
&amp;lt;panel depends="$jnls_mb_counter$"&amp;gt;
  &amp;lt;chart&amp;gt;
    &amp;lt;title&amp;gt;Drilldown Selected PAIR JNL MB&amp;lt;/title&amp;gt;
    &amp;lt;search&amp;gt;
      &amp;lt;query&amp;gt;index=storage_18037 sourcetype=csvRotemA_JNL_SUMMARY NOT DATETIME host=RotemA | eval transfer_in_MB=M_JNL_ASYNC_XFER_RATE/1024,IDs="JNL".JOURNAL_ID | where IDs="$JNL1_field$" | timechart avg(transfer_in_MB) span=1m as "$JNL1_field$ Transfer" | appendcols [search index=storage_18037 sourcetype=csvRotemA_JNL_SUMMARY NOT DATETIME host=RotemA | eval transfer_in_MB=M_JNL_ASYNC_XFER_RATE/1024 | where JOURNAL_ID="$JNL2_field$" | timechart avg(transfer_in_MB) span=1m as "JNL$JNL2_field$ Transfer"]&amp;lt;/query&amp;gt;
      &amp;lt;earliest&amp;gt;$drilldown.earliest2$&amp;lt;/earliest&amp;gt;
      &amp;lt;latest&amp;gt;$drilldown.latest2$&amp;lt;/latest&amp;gt;
    &amp;lt;/search&amp;gt;
    &amp;lt;option name="charting.chart"&amp;gt;line&amp;lt;/option&amp;gt;
    &amp;lt;option name="charting.chart.nullValueMode"&amp;gt;connect&amp;lt;/option&amp;gt;
  &amp;lt;/chart&amp;gt;
&amp;lt;/panel&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 06 Dec 2017 14:31:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-a-substr-from-a-fields-name/m-p/318897#M95367</guid>
      <dc:creator>netanelm7</dc:creator>
      <dc:date>2017-12-06T14:31:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to get a substr from a fields name</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-a-substr-from-a-fields-name/m-p/318898#M95368</link>
      <description>&lt;P&gt;Thank you very much for your answer!&lt;/P&gt;

&lt;P&gt;I've managed to do the first one  but the second one (the rename) didn't work.&lt;/P&gt;

&lt;P&gt;I solved the problem in a different way, i've posted above how.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Dec 2017 15:42:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-a-substr-from-a-fields-name/m-p/318898#M95368</guid>
      <dc:creator>netanelm7</dc:creator>
      <dc:date>2017-12-07T15:42:02Z</dc:date>
    </item>
  </channel>
</rss>

