Getting Data In

Bash echo command no ingested by splunk, whle others are.

Dpeedahnb
Explorer

I have these as the final lines of my bash script:

response=$(curl -H "Authorization: Bearer $access_token" -H "Accept: application/json;odata=verbose" -s "$url")
echo "$response"

echo "Test1"

The script runs, however only 'Test 1' is sent to the index/splunk.
My response, which I know returns the response of the curl command, seems to be being ignored. The only reason I can think for this is that it's too large a body?
The response is in json but is quite large, I'd say pages worth.

Labels (4)
0 Karma

isoutamo
SplunkTrust
SplunkTrust
To se if you get anything what you are expecting just add “ | wc “ inside response evaluation.
0 Karma

Dpeedahnb
Explorer

wc provides '0 2220 612208' as a response when I run the script myself.
However on splunk the echo returns  0 0 0 as an event

0 Karma

isoutamo
SplunkTrust
SplunkTrust
The size of your response is quite much more than max size of shell variable (~32k). This is the reason why it’s didn’t work.
Can you write it to file and then read it there to splunk?
0 Karma

richgalloway
SplunkTrust
SplunkTrust

Anything helpful in splunkd.log?

---
If this reply helps you, Karma would be appreciated.
0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Can’t Make It to Boston? Stream .conf25 and Learn with Haya Husain

Boston may be buzzing this September with Splunk University and .conf25, but you don’t have to pack a bag to ...

Splunk Lantern’s Guide to The Most Popular .conf25 Sessions

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Unlock What’s Next: The Splunk Cloud Platform at .conf25

In just a few days, Boston will be buzzing as the Splunk team and thousands of community members come together ...