Splunk Search

"As" command modifier not working

grook
New Member

New to Splunk. Trying to use the "as" command modifier to change the name of a column. However, the modifier is not being highlighted or changing the column name.

Here is my SPL string:
sourcetype="access_combined_wcookie" status=200 file="success.do"
| table JSESSIONID as UserSession

Tags (1)
0 Karma

pruthvikrishnap
Contributor

Hi Grook,
U will have to rename the command prior to |table, such as
| rename JSESSIONID as usersession
and then call it to table

0 Karma

grook
New Member

Like this?

sourcetype="access_combined_wcookie" status=200 file="success.do"
| rename JSESSIONID as UserSessions
| table UserSession

0 Karma

niketn
Legend

Seems typo, field name should match, so if you rename you should use exact field name afterwards.

  | rename JSESSIONID as UserSessions
  | table UserSessions

If you have space or special characters in the field name you should use double quotes. For example

  | rename JSESSIONID as "User Session IDs"
  | table "User Session IDs"
____________________________________________
| makeresults | eval message= "Happy Splunking!!!"

pruthvikrishnap
Contributor

yeah did it work?

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

[Puzzles] Solve, Learn, Repeat: Character substitutions with Regular Expressions

This challenge was first posted on Slack #puzzles channelFor BORE at .conf23, we had a puzzle question which ...

Splunk Community Badges!

  Hey everyone! Ready to earn some serious bragging rights in the community? Along with our existing badges ...

[Puzzles] Solve, Learn, Repeat: Matching cron expressions

This puzzle (first published here) is based on matching timestamps to cron expressions.All the timestamps ...